From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Get Date/Time String after 2040

OK,


So I looked into the Get Date/Time String date function.

 

It states that it will take a LabVIEW timestamp and convert it to string.

But when the date is greater than 2040 it seems to return the time wihin the range of 1904 why would that be?

 

Attaching example

 

Regards,

Maciej


Message 1 of 11
(3,244 Views)

I'd say you found a bug.  You can use the Format Date/Time String instead though.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 2 of 11
(3,237 Views)

No Bug.

 

It is the anticipated rollover of the U32 seconds = 4294967295 seconds or about 136.099 years from 1-1-1904 which gives you arounf 2040.

 

Not to worry NI changed the Date-time to a U64 to correct this issue in a recent version of LabVIEW.

Visualize the Solution

CLA

LabVIEW, LabVIEW FPGA
Message 3 of 11
(3,234 Views)

@SPECTRE Dave wrote:

No Bug.

 

It is the anticipated rollover of the U32 seconds = 4294967295 seconds or about 136.099 years from 1-1-1904 which gives you arounf 2040.

 

Not to worry NI changed the Date-time to a U64 to correct this issue in a recent version of LabVIEW.


Yes, bug.  I'm using LV2011 and got the same results.  The LV Help says it is using 64 bits for the seconds since 1-1-1904.  Therefore my rollover should be in, well, never (the sun will die first).  But the timestamp won't go past 7:00pm on 12/31/3000.  As I showed above, the Format Date/Time works just fine.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
Message 4 of 11
(3,227 Views)

Hello gentlemen,


Thank you for your input

I assumed that the LabVIEW timestamp is 128 bits in total:

http://www.ni.com/white-paper/7900/en

 

an i64 for the seconds and a U64 for the fractions of the second.


Since the Get Date / Time String accepts the whole timestamp ( which means 128 bit value ) ; I'm still missing the connection between the U32 Spectre Dave metioned.

 

Thanks,

Maciej


0 Kudos
Message 5 of 11
(3,219 Views)

@Mac671 wrote:

Hello gentlemen,


Thank you for your input

I assumed that the LabVIEW timestamp is 128 bits in total:

http://www.ni.com/white-paper/7900/en

 

an i64 for the seconds and a U64 for the fractions of the second.


Since the Get Date / Time String accepts the whole timestamp ( which means 128 bit value ) ; I'm still missing the connection between the U32 Spectre Dave metioned.

 

Thanks,

Maciej


Spectre Dave was referring to an I32 for the seconds since epoch.  The math comes out about right, so it seems like Get Date/Time String only looks at the lower 32 bits of the seconds since epoch.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 6 of 11
(3,212 Views)

thinking out loud...

 

the time conversion depends on the OS... could 32/64 bit a factor?

 

Done thinking for today.

 

Ben

Retired Senior Automation Systems Architect with Data Science Automation LabVIEW Champion Knight of NI and Prepper LinkedIn Profile YouTube Channel
Message 7 of 11
(3,205 Views)

The OS I used was 64 bit , the LabVIEW process however was 32. I'll give it a try on a 64 LV bit machine later in the day.


Message 8 of 11
(3,179 Views)

Running this code on a 64 bit ver of labview has no change.

 

In my view the Get Date / Time String has a bug in it.

 

The underlying timestamp constant that is wired to it's tereminal has all the information required to conduct the conversion of the date to string. The timestamp constant is described in detail in a link posted above.

 

The Format Date/Time String funtion ( as metioned by Crossrulz ) has the same input an can compute the appropriate value.

 

Maciej


Message 9 of 11
(3,172 Views)

Has someone filed a bug report for this issue? Or, did anyone from NI respond to this elsewhere in these forums with a CAR#?

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 10 of 11
(2,915 Views)