Beijer Electronics (formerly QSI Corporation)

Manufacturer of Mobile Data and Human Machine Interface Terminals.
It is currently Mon Nov 20, 2017 2:20 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Timezone
PostPosted: Wed Sep 02, 2009 11:38 am 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
Hi,

In order to use the Data functions to convert time to hours, minutes, etc. do I have to set the Timezone someplace? All our time is GMT and I want to make sure I'm converting it correctly. Something tells me this is a dumb question.

Thanks,

Joe


Top
 Profile  
 
 Post subject: Re: Timezone
PostPosted: Wed Sep 02, 2009 11:39 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Which data functions are you referring to?

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
 Post subject: Re: Timezone
PostPosted: Wed Sep 02, 2009 11:49 am 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
I meant Date functions. Specifically,
DateTimeFunctions.ConvertToRTCTime


Top
 Profile  
 
 Post subject: Re: Timezone
PostPosted: Wed Sep 02, 2009 11:52 am 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
The DateTimeFunctions are timezone agnostic (they have no concept of a time zone).

You will need to manually offset GMT to local time before calling that function.

Another thing to keep in mind if you are getting your dates from an external source is that they do not use a time_t (seconds from 1970), rather they measure in seconds from Jan 1, 2000. So you may need to apply another offset to convert from a time_t to a timehandle.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
 Post subject: Re: Timezone
PostPosted: Wed Sep 02, 2009 12:54 pm 
Offline

Joined: Wed Feb 11, 2009 9:32 am
Posts: 34
Jeremy,

I have offset the time to Jan 1, 2000. But what do you mean

"You will need to manually offset GMT to local time before calling that function."?

I get a time from an external source that is in GMT time. I offset the time to Jan 1, 2000 then use the functions. That should be all I have to do correct? Or am I missing something?


Top
 Profile  
 
 Post subject: Re: Timezone
PostPosted: Wed Sep 02, 2009 12:57 pm 
Offline
QSI Support
QSI Support
User avatar

Joined: Wed Mar 08, 2006 12:25 pm
Posts: 881
Location: Salt Lake City, Utah
Probably the easiest thing to try is just see what you get. If you are off by a few hours then you know you need to offset for local time.

I suppose "I offset the time to Jan 1, 2000" is perhaps a bit ambiguous (as, in fairness, was my earlier comment). Are you offsetting your GMT time_t time to 12:00:00 am, Jan 1, 2000 local time or GMT time? If you are offsetting to local time then you are done. If you are offsetting to GMT time then you will probably still have to offset to local time.

At this point, I would take a known time and see what I get out and decide how to proceed from there.

_________________
Jeremy
http://www.beijerinc.com


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 7 hours


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group