RT (Request Tracker) Date Handling

Scott Penrose scottp at dd.com.au
Thu Nov 6 22:28:25 CST 2003


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On Friday, Nov 7, 2003, at 15:13 Australia/Melbourne, Rick Measham 
wrote:
>
> By definition, unix time stamps are seconds since 1970-01-01T00:00:00 
> UTC.
>
> 	1068128046 = 2003-11-06T14:14:06
>
> But it should be 2003-11-07T12:14.
> Which is 22 hours later.
>
> Basically RT is getting its UTC and Australia/Melbourne all askew.

Yes this is exactly what I am expecting.

What they are doing is this... Getting time (which is always at GMT as 
you describe above) then saying lets convert it to GMT by subtracting 
11 hours - which of course it already has done when you get it from the 
system !!! then they stick that into the database.

Then on the way out of the database they add 11 hours back to it again.

Ahhhh... bad coders.

> RT says "12:14, that would be UTC, better convert it to 
> Australia/Melbourne by subtracting 11 hours. That would be 1:14" and 
> sends that to the database.
>
> Database says "1:14, that would be UTC, better show Scott the local 
> equivelent and subtract 11 hours."
>
>
> Whereas the conversation SHOULD be:
>
> RT says "12:14, that would be Australia/Melbourne, better convert it 
> to UTC by adding 11 hours. That would be 23:14" and sends that to the 
> database.
>
> Database says "23:14, that would be UTC, better show Scott the local 
> equivelent and subtract 11 hours."
>
> And you get 12:14, which is the value you want.
>
> As for how to fix it, it's a bug that RT should fix. The other option 
> is to force the database to use the UTC timezone and then think of all 
> the results as being localtime :/

My problem is how to make this work with the existing code and existing 
database, both of which I don't have access to changing. Nor do I have 
the ability to futz with the results after the SQL.

Damn them !

Is there some way I can add 11 hours in the query in mySql

eg:
	UNIX_TIMESTAMP(LastUpdated) + (11 * 3600) as uts

Scott
- -- 
Scott Penrose
VP in charge of Pancakes
http://linux.dd.com.au/
scottp at dd.com.au

Dismaimer: If you receive this email in error - please eat it 
immediately to prevent it from falling into the wrong hands.

Please do not send me Word or PowerPoint attachments.
See http://www.fsf.org/philosophy/no-word-attachments.html
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (Darwin)
Comment: For info see http://www.gnupg.org

iD8DBQE/qx9sDCFCcmAm26YRAiYEAKCKO0VC5mB9EHwig/hwP/SrxUxLJQCgsVB9
IHWFf5p0Yt0CdUXx/t2TvuI=
=oMFk
-----END PGP SIGNATURE-----




More information about the Melbourne-pm mailing list