LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Two consequtive Date Files generation

Solved!
Go to solution

The last time I looked...

 

The Mug-bearer's solution worked on every day where you did not have a DST event. If the time you start with is in the "witching hour" of 2:00 AM...

 

Adding a day worth of second wil return the same day OR you will miss a day completely.

 

So....

 

Watch out if you are coding for DST timezones.

 

Ben

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

Those are not actually expression nodes, they are "Convert Unit" nodes. If you have a value without units, it will apply the unit to the number. If you have a value with units, it will convert to the units you tell it to and return a unitless number. So we start with 1 (no units), then have 1 (day) after the first node. After the second node we convert to seconds and strip the units giving 86,400 (no units).

 

Another way to see it is to right click the constant >> Visible Items >> Unit Label. You can tack on a "d" here for days, and remove the first Unit Convert node.

0 Kudos
Message 12 of 15
(1,001 Views)

Yes Ben.  That was a valid point on DST.

 

Right now this code runs only in India where DST is not in force. Of course if its deployed in a DST zone then I need to be careful.

 

Thanks

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 13 of 15
(989 Views)

@Gregory wrote:

Those are not actually expression nodes, they are "Convert Unit" nodes. If you have a value without units, it will apply the unit to the number. If you have a value with units, it will convert to the units you tell it to and return a unitless number. So we start with 1 (no units), then have 1 (day) after the first node. After the second node we convert to seconds and strip the units giving 86,400 (no units).

 

Another way to see it is to right click the constant >> Visible Items >> Unit Label. You can tack on a "d" here for days, and remove the first Unit Convert node.


Got it. Thanks for the calrification!

Raghunathan
LabVIEW to Automate Hydraulic Test rigs.
0 Kudos
Message 14 of 15
(982 Views)

@ Ben :

Waow... there are still people remembering this 😮

Maybe i'm not that old then Smiley Very Happy

 

To work around the DST nonesene you could force the time to noon after getting the timestamp, no?

2016-02-15_165437.jpg


We have two ears and one mouth so that we can listen twice as much as we speak.

Epictetus

Antoine Chalons

Message 15 of 15
(980 Views)