Jump to content

[SOLVED] Expiry Time with Daylight savings


sangli1980

Recommended Posts

HI I need to sort this issue ASAP, can someone please help. We have a deal with expires at a certain time, due to daylight savings the clock has moved ahead by 1 hour but the deal still shows expiring at original time and not the server time. The code is below:

 

$db->where[] = 'start_date = "'.date('Y-m-d', time() - 10 * 3600).'"'; //CHANGE

$db->where[] = 'start_time = 0 OR start_time <= "'.date('H:i:s', time()).'"';

$db->where[] = 'end_time = 0 OR end_time >= "'.date('H:i:s', time()).'"'; //CHANGE

$db->order = 'start_date, start_time DESC';

 

 

 

 

function DealTimeLeft ($date, $time = 0)

{

 

$message = 'Deal Closed';

 

if ($time == 0) {

 

$endtime = strtotime($date) + 86400 + 36000;

 

} else {

 

$endtime = strtotime($date)+$time;

 

}

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.