We help IT Professionals succeed at work.
Get Started

GMT Daylight Savings Time discrepancy !!!

sasnaktiv asked
Last Modified: 2012-05-12
I have a php program that executes certain tasks at certain hours during the day.
Those tasks are scheduled using Greenwich Mean Time + TimeZones.
The tasks are performed in the United States & Canada. Everything has been working on time until this past weekend.
Now all the tasks are an hour late. Here's the problem. GMT went off Daylight Savings Time and on to Standard Time this past weekend, Sunday October 30th.
But the United States will remain on Daylight Savings until Sunday November 6th. After that all the tasks will be on time, but it's important that I compensate for the time change during this week when the two differ.
How can I do that just for this week?
Additionally I will have the opposite problem in the Spring when GMT goes back on Daylight Savings Time on Sunday March 25 2012 and the U.S. goes on Daylight Savings Time March 11, 2012.

Thanks for the help,

Below is an example of what's working properly now:

$Today00=date("Y-m-d"); //0000-00-00
$Today0=date("Y-n-j"); // 0000-0-0
$CurrentGMT_Hour = gmdate("G") ;

  $Today00 = date("Y-m-d",time());
  $GMT_Hour = date("H",time());
  	 if ($GMT_Hour == 00){$GMT_Hour = 24;} else {$GMT_Hour = date("H",time());}
// ........  BEGIN DEFINE WHO TO CALL ..............// 

$PerformTask= "participants WHERE  (
   (current_status='a' AND next_task_date='$Today00' AND GMT_task_hour='$GMT_Hour' AND  my_agent='$my_agent') 
OR (current_status='a' AND GMT_taskDate2='$Today00' AND GMT_task_hour2='$GMT_Hour' AND  my_agent='$my_agent')   
OR (current_status='a' AND GMT_taskDate3='$Today00' AND GMT_task_hour3='$GMT_Hour' AND  my_agent='$my_agent')   
OR (current_status='a' AND GMT_taskDate4='$Today00' AND GMT_task_hour4='$GMT_Hour' AND  my_agent='$my_agent')   

OR (current_status='a' AND next_task_date='$Today0' AND GMT_task_hour='$GMT_Hour' AND  my_agent='$my_agent')
OR (current_status='a' AND GMT_taskDate2='$Today0' AND GMT_task_hour2='$GMT_Hour' AND  my_agent='$my_agent')
OR (current_status='a' AND GMT_taskDate3='$Today0' AND GMT_task_hour3='$GMT_Hour' AND  my_agent='$my_agent')   
OR (current_status='a' AND GMT_taskDate4='$Today0' AND GMT_task_hour4='$GMT_Hour' AND  my_agent='$my_agent')
"; // etc. ...

Open in new window

Watch Question
This problem has been solved!
Unlock 1 Answer and 13 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE