Jump to content

Complex time problem.. Gurus can help


karthikeyan_coder

Recommended Posts

here is the two functions for showing time in the format "3:57 pm"

[code]function convert_timestamp($timestamp, $timezoneOffset=0) {
$replacements = array(  '-' => '',
' ' => '',
':' => '');
$timestamp = strtr($timestamp, $replacements);

return $timestamp?mktime(
substr($timestamp,8,2),
substr($timestamp,10,2) - $timezoneOffset + $GLOBALS['fc_config']['timeOffset'],
substr($timestamp,12,2),
substr($timestamp,4,2),
substr($timestamp,6,2),
substr($timestamp,0,4)
):0;
}

function format_Timestamp($timestamp, $tzoffset) {
return gmdate($GLOBALS['fc_config']['timeStampFormat'], convert_timestamp($timestamp, $tzoffset));
}[/code]

i need these functions to show US time... how can we change these functions to show US time?

Thank you.
Link to comment
https://forums.phpfreaks.com/topic/24118-complex-time-problem-gurus-can-help/
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.