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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.