I need a snippet of code to display the current time of my location as in 12:01 PM EST. I want to put it in the header of my site next to the search box. I already have the date...also the time but can't get it to show local..only UTC
Codi
I need a snippet of code to display the current time of my location as in 12:01 PM EST. I want to put it in the header of my site next to the search box. I already have the date...also the time but can't get it to show local..only UTC
Codi
Can you use the date('g:i A e') function?
This is what I have now:
<?php print(date ('g:i A T')); ?>
and this is what it shows ast 12:34 PM EST
4:34 PM UTC
When I used your snippit it showed
5:28 PM UTC
at te bottom of that page was something about setting timezone, a novice guess from me?
<?php
date_default_timezone_set('EST');
echo date('g:i A'); ?>RVoodo....you are the MAN or the LADY as the case may be...that did the trick...Thank you very much. Your having taken the time to assist is greatly appreciated.
I am slowly putting together this site http://webnewsfeed.com and http://webnewsfeed.com/blog
All input is greatly accepted.
Also thanks to vtxyzzy for your effort.
Thanks again
Codi
sweet! heluva good guess I'd say!
and MAN is correct....
Actually, you can set the Timezone in Admin->Settings->General so you don't have to code it in the php.
Please mark this topic 'Resolved'.
This topic has been closed to new replies.