Jump to content

American Time Zone Correctness


EZE

Recommended Posts

How can I get the correct American time using date()? Right now the phpfreaks clock says its 10:30:03pm, where as it is 10:31 pm right now where I am. Here is what I used:

echo date("l, g:i:s A, F dS, Y");

This outputs Friday, 8:32:34 PM, February 02nd, 2007. I used the previous date output inside a mail() function, like this:

	$ip = gethostbyaddr($_SERVER['REMOTE_ADDR']);
$browser = $_SERVER['HTTP_USER_AGENT'];
$date = date("l, g:i:s A, F dS, Y");
$ref = $_SERVER['HTTP_REFERER'];
$mail  = mail($to, $subject, "$message\n----- \nUsers IP: $ip\nUsers Browser: $browser\nDate Sent: $date\nSent From: $ref", $extra);

What can I do to get it to output correctly?

Link to comment
https://forums.phpfreaks.com/topic/36870-american-time-zone-correctness/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.