bjustice Posted June 6, 2018 Report Share Posted June 6, 2018 (edited) Hey guys! I have a problem that is giving me a headache. Kudos to anyone with any suggestions. I have a small subvi that needs to do the following: input = (UINT64) nanoseconds since the start of the LabVIEW time epoch output = (cluster) timestamp expressed as: (INT16) Julian day, (UINT32) milliseconds since start of the day, (UINT16) microseconds since start of the day. Now, I could indeed just use the LabVIEW seconds to Date/Time VI. However, this VI gets very lossy near the fractional second regime. (It is using a DBL after all.) I've tried to correct for this by doing the sub-second math myself. See my current attempt: However, this solution still has a bad edge case. Try the following inputs: 1528210282999999871 1528210282999999872 This shows that the "seconds" output of the LabVIEW seconds to Date/time function rolls over unexpectedly (I assume due to the lossy-ness of the function.) Does anyone have any suggestions? I could write this seconds to Date/time code from scratch myself, but I'm unfamiliar with the annoying calculation for determining number of days since the start of the LabVIEW epoch. Thoughts? Suggestions? Thanks! LV timestamp to SUN timestamp.vi Edited June 6, 2018 by bjustice Quote 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.