Jump to content

DST bug in 'Var2Data' and 'DBVar2Data' for timestamp


David Boyd

Recommended Posts

This has been confirmed in email correspondence with NI.

When converting an OLE Date variant, or an OLE BSTR variant formatted as a date/time, into a timestamp value using the 'Variant to Data' primitive or the 'Database Variant to Data' primitive (this one is exposed on palettes which ship with the DB Connectivity toolset), the timestamp value will be off by an hour if the current DST setting is not the same as the DST setting in effect for the value being converted.

If converting to a LV string value, the primitives behave as expected.

My workaround involves getting the DST flag values for the current timestamp and the converted timestamp, and adding an offset to the converted timestamp based on the difference between the flags. I've attached a VI which can be used in place of the Var2Data primitives.

Dave

Download File:post-16-1073112847.vi

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.