Highlighted
Absent Member.
Absent Member.
6070 views

GMT Offset - Can't compare date/time fields in scripts??


Discussion posted 3/6/08 by George Bonvanie
Details:

germancasaretto

We need to do a simple comparison: take SubmitDate and check that the field "Deploy Date" entered by the user isn't lower than submitdate.
The thing is, "Deploy Date" is a Date only field.
This means that SubmitDate could be Monday January 7th 4:00PM, and if I enter Deploy Date as Monday January 7th, then it would be correct, as this date is bigger or equal than submitdate.
In order to do this, we truncate SubmitDate to get Start Of Submit Date; 01/07/2008 00:00:00
Then, comparing to 01/07/2008 00:00:00 entered imn Deploy Date, there would be the same and then, correct.
What 's going wrong here is that SubmitDate is stored in the DB as GTM+00 and TeamTrack modifies its value to show it to the user according to his GMT time zone.
But the "Deploy Date" field the user enters, is in HIS GTM time zone.
So if I compare both values, the SubmitDate one has the standard GTM, and the one entered by the user has his GMT, different to the first one.
We've developed a workaround to this by adding in the script 10800 to the field entered by the user (we're in GMT-3, 3 hours, 10800 seconds) to compare them.
But this workaround become to its end last week, when we entered to Summer Time and we set our clocks one hour later. Until march we'll be in Energy Saving Summer Time.
Finally, my question is: Do I really have to change all my date-comparing scripts each time we change the hour???
Thanks,
German
Posted 1/7/2008 12:26 PM

lmattie

TeamTrack should convert the user entered date/time to GMT as well and this should be done before your script sees it. So the only thing you should have to worry about is the Date vs Date/Time field problem. There was a bug in this area with one of the TT versions, so make sure you aren't dealing with the bug.
Posted 1/7/2008 5:40 PM

germancasaretto
Posted 1/8/2008 5:01 AM

germancasaretto

It sounds it'm dealing with that bug then...
If I call GetFieldValue with a Date/Time field already stored in the DB, then I get it in GMT+00, the "official tme". But if I call it with a field that is been entered by the user in that transition, then I get the value in the user's GTM.
By the way, the scripts running are Post-Transition and TT version is 6.6.1 (Build 66109).
However, I think we've been having this problem since a couple of versions.
I'll appreciate any hint you could give us on this issue.
Thanks,
German
Posted 1/8/2008 5:06 AM
0 Likes
1 Reply
Highlighted
Absent Member.
Absent Member.

Re: GMT Offset - Can't compare date/time fields in scripts??


This is an old migrated post that has been assigned status Complete.
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.