...

View Full Version : GMT date, with AM/PM



Dan13071992
02-01-2012, 10:35 PM
hi guys, how would i make this GMT time/date work by displaying AM or PM, i know its a very novice question, but is it possible?

mlseim
02-01-2012, 10:42 PM
Bookmark this page: http://php.net/manual/en/function.date.php
You'll use that all the time.

quote ...
"... make this GMT time/date ..."

What is "this"? You're not showing us anything.

Dan13071992
02-01-2012, 10:44 PM
Bookmark this page: http://php.net/manual/en/function.date.php
You'll use that all the time.

quote ...
"... make this GMT time/date ..."

What is "this"? You're not showing us anything.


sorry, i forgot to past in what i had

<?php $date = gmdate('h:i:s'); echo "$date"; ?>

mlseim
02-01-2012, 10:49 PM
<?php $date = gmdate('g:i:s A'); echo "$date"; ?>

g or h .. depending on leading zero.

Also know that you can force the server to
use whatever timezone you wish. Otherwise,
the calculations of date and time are based
off of your server. That might be important
for daylight savings time, as some cities in
the world don't honor DST.



.

Dan13071992
02-01-2012, 10:51 PM
<?php $date = gmdate('g:i:s A'); echo "$date"; ?>

g or h .. depending on leading zero.

Thanks, just as you was writing that, i was uploading what I had worked out from the link you gave me, we got exactly the same apart from i used the h instead of g.

Thanks :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum