Timestamp timezone

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

Michael Huntsacker
New php-forum User
New php-forum User
Posts: 5
Joined: Tue Jan 28, 2003 11:38 am

Timestamp timezone

Postby Michael Huntsacker » Tue Jan 28, 2003 11:45 am

Hello,

I am using the following code to display the last modified time of a page, but it shows up as the timezone of the server location, ie Houston. How can I adjust it to display the time for PST?

<!--#config timefmt="%m/%d/%y, %I:%M %p %Z" -->
<!--#echo var="LAST_MODIFIED" -->

Any help greatly appreciated!
Thanks
Mike (newbie)

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Wed Jan 29, 2003 1:34 am


Michael Huntsacker
New php-forum User
New php-forum User
Posts: 5
Joined: Tue Jan 28, 2003 11:38 am

Postby Michael Huntsacker » Thu Jan 30, 2003 10:36 am

Ok so I found that
O = Difference to Greenwich time (GMT) in hours Example: +0200.

How would that be added to this line:
<!--#config timefmt="%m/%d/%y, %I:%M %p %Z" -->

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Fri Jan 31, 2003 12:13 am

syntacys of PHP is
<?
echo $variable;
?>

$date date("you date format");

if you want create your own date you mktime() function =)

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Fri Jan 31, 2003 1:56 am

OR... if yer lazy like me.. take the unix timestamp which is in seconds from jan 1, 1970 er somethin like that.. I may be wrong... multiply 60 times 60 (which is the number of seconds in an hour) and multiply it by X the number of hours from the hosts timezone. and now for a wonderful example

lets say a timestamp is 1234567 which is a server in california(PST) but I am in new york (EST) which is 3 hours ahead.

(60*60)*3 .. let me get the windows calculator to do this one...

add 10800 to your timestamp which is 1245367 and do a simple date() function thingy and whoala.. you have the correct time...


you know thinking about it.. that might not be the easiest way to do it.. but... there is always more than one way to skin a cat.

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Fri Jan 31, 2003 2:06 am

if ("lazy" == "Pejone")
{
echo "???";
} else {
exit;
}

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Fri Jan 31, 2003 2:12 am

if('lazy' == 'redcircle')
sleep 5000;
else
exit;

User avatar
Oleg Butuzov
Last Samuray
Last Samuray
Posts: 831
Joined: Sun Jun 02, 2002 3:09 am

Postby Oleg Butuzov » Fri Jan 31, 2003 2:23 am

LOL! =)

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Fri Jan 31, 2003 2:24 am

I love programming humor.

Michael Huntsacker
New php-forum User
New php-forum User
Posts: 5
Joined: Tue Jan 28, 2003 11:38 am

Postby Michael Huntsacker » Sun Feb 02, 2003 11:49 pm

ummmm...

I dont really know anything about code :cry: , so how would I change this?

<!--#config timefmt="%m/%d/%y, %I:%M %p %Z" -->
<!--#echo var="LAST_MODIFIED" -->

Michael Huntsacker
New php-forum User
New php-forum User
Posts: 5
Joined: Tue Jan 28, 2003 11:38 am

Postby Michael Huntsacker » Wed Feb 05, 2003 11:54 pm

any ideas?

Michael Huntsacker
New php-forum User
New php-forum User
Posts: 5
Joined: Tue Jan 28, 2003 11:38 am

Postby Michael Huntsacker » Tue Feb 11, 2003 11:09 am

help help help please please please


Return to “PHP coding => General”

Who is online

Users browsing this forum: No registered users and 1 guest

cron