If you are unable to create a new account, please email support@bspsoftware.com

 

News:

MetaManager - Administrative Tools for IBM Cognos
Pricing starting at $2,100
Download Now    Learn More

Main Menu

GMT to local time conversion

Started by rcoon, 12 Apr 2011 07:35:37 PM

Previous topic - Next topic

rcoon

Hello,

I've posted this same question in the Cognos 10 forum, but I would guess it applies equally to Cognos8.

I have data that includes dates/times stored as GMT timestamps. I would like to be able to display this data in the local timezone. To that end, I am following an approach similar to what has been outlined in https://www-304.ibm.com/support/docview.wss?uid=swg21339907 which basically has you look up the user's timezone ID, and map it to a number of hours that should be added or substracted from the GMT time.

All good, however, this method seems to only cover the case where all users have set their own personal timezones, and I would like to be able to also cover what is actually the default case, where the user has simply stayed with the default (server) timezone. Is there a server-wide property that is similar to account.personalInfo.timeZoneID ?

With no server timeZoneID property that I know of, I decided to take another approach. I am getting the current_timestamp, and then parsing it to identify the time zone offset, which can then be added/substracted to the GMT times in my data, building local timestamps. I've got this working, but the results are incorrect due to the current_timestamp not handling daylight savings properly. If I call current_timestamp right now, I get the result 'April 12, 2011 5:12:50.526 PM GMT-08:00' (I'm in CA). This is not entirely correct. The time is right, but the time zone offset it wrong. While the offset for PST is -08:00, due to DST, my current timezone is PDT, and the offset should be -07:00.  Is there any way to get the correct timezone offset? Of course, if a server wide timeZoneID property is identified, this last part becomes moot.

Thanks for your time.

rob