Jump to content

php dst help..


only1dil

Recommended Posts

hi guys m a beginner in programing.. and i would like some help of urs in this case.. i have this date/time fuction.. in which i want to implement the DST .. i knw php takes care of dst on its own.. but wht if its not set.. or if its the older version on php..

how can i do this..  here is the code.. which i want to modify //

 

 

[[[[                                $globals['pgtimezone'] = (float) (empty($user['timezone']) ? $globals['timezone'] : $user['timezone']);        ]]]]

 

 

 

//If $format is given then TODAY feature is overided

 

function datify($timestamp, $today = true, $adjust = true, $format = false){

 

global $l, $user, $globals;

 

//Are we to adjust time - By default yes

if(!empty($adjust)){

 

$timestamp = max(0, $timestamp - ( (date('Z', time()) / 3600) - $globals['pgtimezone']) * 3600);

 

}

 

if(!empty($format)){

 

return date($format, $timestamp);

 

}

 

$todaytime = max(0, time() - ( (date('Z', time()) / 3600) - $globals['pgtimezone']) * 3600);

 

//The date thingy

if($today && date("F j, Y", $timestamp) == date("F j, Y", $todaytime)){

 

$time =  date("g:i a", $timestamp);

 

return $l['today'].$time;

 

}else{

 

return date("F j, Y, g:i a", $timestamp);

 

}

 

}

 

 

 

i want to give user the option for dst.. if they check the box..  to enable the dst. i want to give the time out in dst format..

Link to comment
https://forums.phpfreaks.com/topic/229375-php-dst-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.