Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 25 Jun 2007 @ 12:33:23 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: CURRENT_TIMESTAMP function bug?
 
From:   McCall, Glenn David

Unfortunately I don't have a reference that I can provide, but let me try putting my understanding of how this works forward.

The Timestamp (at least in Java) is made up of multiple parts. First is the time and date itself expressed in UTC (a.k.a. GMT) and an offset (the timezone). The separation of the two parts (UTC time) and timezone is important for time comparisons to be made. For example two transactions that occur at 10:00 in Sydney and 08:00 in Perth (Australia) did in fact occur at the same time. Sure the local times are different, but they did both occur at 0:00 UTC.

More often than not, the UTC time is useless to the mere mortal end user (like me), so the custom is to apply the timezone to the UTC time. The result will be that the two transactions (that occurred at 0:00) will be displayed as 08:00 (in Perth) and 10:00 (in Sydney)

Now in terms of queryman / SQL Assistant, I think it errs on the side of full disclosure. Thus it displays the date/time (as UTC) together with the offset.

If you queried your table with the timestamp with timezone and printed it using the following (deprecated) Java code you should be able to see the time queryman shows (UTC), the time adjusted for the locale and the number of minutes represented by the timezone offset:

     Timestamp ts = "value from your database"
     System.out.println ("UTC: " + ts.toGMTString());
     System.out.println ("Local: " + ts.toLocaleString ());
     System.out.println ("TZ offset (minutes): " + ts.getTimezoneOffset());

Hope this makes sense

Glenn Mc



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023