[rt-devel] RT::Date GMT vs Local

Ruslan U. Zakirov cubic at acronis.ru
Fri Mar 26 13:27:06 EST 2004


Phil Homewood wrote:
> Ruslan U. Zakirov wrote:
> 
>>Date handling in RT have some issues with subj.
>>Example:
>>SetToNow - set to local time, but
>>SetToMidnight - use GMT.
> 
> 
> I'd argue that "now" is "now" whatever timezone you work
> in, and RT always uses UTC. "Now" in UTC is the same time
> as "now" in localtime -- it's "now". I don't see any
> inconsistency here.
	Hello, Phil and other.

I didn't answer because I did think that you are right.

Now, I want return to 'GMT vs Local' in RT API.
Attached show scrip show that API is not coherent enought.
Output:
DBIx::SearchBuilder->DoSearch Query:  SELECT count(main.id) FROM Tickets 
main  WHERE ((main.EffectiveId = main.id)) AND ((main.Status != 
'deleted')) AND ((main.Type = 'ticket')) AND ( ( (main.Created > 
'2004-03-25 14:55') ) )
Tickets 294
...

DBIx::SearchBuilder->DoSearch Query:  SELECT count(main.id) FROM 
Transactions main  WHERE ((main.Created > '2004-03-25 17:55:13'))
Transactions 1964

I think where clauses on Created field isn't equal for this selects, but 
  _must_ be the same.

Output:
2004-03-25 18:10:23 (->ISO)
Thu Mar 25 21:10:23 2004 (->AsString)

And what is it? Tricky magic. One sub return local time(that I see on my 
hand watches right now) and another return GMT(people somewhere far in 
London see on thier hand watches at same time).
Did I request something different??? No. Same, but noted in name of sub 
then undocumented feature.

Should I debug SQL queries every time I try to use RT API?

			Good luck. Ruslan.



More information about the Rt-devel mailing list