Jump to content
php.lv forumi

problēmas ar timestamp un laika zonām


Recommended Posts

Sveiki!

 

lūk vienkāršs kods

<?php

$time = time();

echo $time;

echo '<br />';

echo strftime("%c", $time);

?>

 

 

 

šādi tiek izdrukāts uz localhost

 

1257886792
11/10/09 22:59:52

 

šādi kad kods hostēts uz kautkāda ārzemju servera (laikam Holandes, īsti neatceros :), bet tas nav svarīgi)

 

1257886581
Tue Nov 10 20:56:21 2009

 

 

 

kā lai panāk to, ka hostējot uz tā servera tiktu drukāts latvijas laiks?

mēģināju

setlocale(LC_ALL, 'lv_LV')

, bet tas tikai nomainīja dienas nosaukumu no "Tue" uz "Otrdiena"

Edited by gaziks52
Link to post
Share on other sites

"These PHP configuration settings are customizable by the server administrator. They are listed for reference only."

 

njā ... ciks es sapratu, tā kā man ir vislētākais hosting plāns tad es nevaru izmainīt php.ini

 

 

-------------------------------------------------------------------------------------------------------------

 

nē tomēr kļūdījos .... viss sanāca lietojot šo fukciju

date_default_timezone_set('Europe/Riga');

 

paldies par info

Edited by gaziks52
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...