LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Can I get MJD (date and time) in LabVIEW 2012 SP1?

Solved!
Go to solution

I need to time stamp my data before sending it to the file.  I have been doing this with the standard calendar date and time but MJD is what we prefer to use.  How can I get an MJD timestamp in LabVIEW 2012 SP1?

0 Kudos
Message 1 of 5
(3,082 Views)
Did you check this http://www.ni.com/example/26818/en/ ??
Thanks
uday
0 Kudos
Message 2 of 5
(3,068 Views)

Hello Brad_Henry,

 

The Format Date/Time String will return the day of the year when the %j argument is used, as per this help document:

 

LabVIEW Help: Format Codes for the Time Format String

http://zone.ni.com/reference/en-XX/help/371361J-01/glang/codes_for_time_format_str/

 

If you're looking for the actual MJD, I'm not aware of a built-in function that generates this so you'll probably need to create or find a function to calculate it manually.  This should pretty basic arithmetic, and it looks like people have already made a few public examples, the first two search results here look to be just about what you need:

 

ni.com search:

http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/sn/catnav:ex/q/julian/

 

Regards,

Tom L.
0 Kudos
Message 3 of 5
(3,061 Views)

Thank you but that does not give MJD, it gives JD.

 

Brad

0 Kudos
Message 4 of 5
(3,060 Views)
Solution
Accepted by Brad_Henry
Check the formula for converting JD to MJD
http://www.iers.org/nn_10828/IERS/EN/Service/Glossary/mjd.html

The Modified Julian Day (MJD) is defined as MJD = JD - 2400000.5 , where JD is the Julian Day
Thanks
uday
Message 5 of 5
(3,053 Views)