09-03-2015 01:20 PM
I want to store calibration dates in a file so they can be checked to the current date and notify the user if any of the equipment is out of calibration.
What would be the easiest way to accomplish this?
Using scan fomr string I have been able to change the date string (MM/DD/YY) to numbers, but how do I turn them into a timestamp?
Solved! Go to Solution.
09-03-2015 01:23 PM - edited 09-03-2015 01:25 PM
Look here (if you have hours, minutes, and seconds along with a date):
http://digital.ni.com/public.nsf/allkb/95D386A68269A53A86257082001DAED0
09-03-2015 01:23 PM - edited 09-03-2015 01:24 PM
Check out the documentation on the Format DateTime String function. You can format a string to and from a timestamp datatype using %<>T or %<>t
Eric, that cluster manipulation is overkill just to go from string to timestamp and back.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
09-03-2015 01:24 PM
I'd really recommend you use the ISO standard for time. You can use the Scan From String, and Format Into String to go to and from a timestamp.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
09-03-2015 01:27 PM
From Hooovahh's link, this is what you want:
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
09-03-2015 01:34 PM
09-03-2015 02:52 PM - edited 09-03-2015 02:53 PM
@Eric1977 wrote:
Look here (if you have hours, minutes, and seconds along with a date):
http://digital.ni.com/public.nsf/allkb/95D386A68269A53A86257082001DAED0
This seems like a simpler solution.
09-03-2015 03:02 PM
It's not a simpler solution... It may be an easier solution to understand because it breaks everything down in to a cluster of info, but the overhead (and space) taken up by that is much larger. You should really get comfortable with string formatting and conversion using the single string scan VIs from the other posts above.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
09-03-2015 05:17 PM - edited 09-03-2015 05:18 PM
@James.M wrote:
It's not a simpler solution... It may be an easier solution to understand because it breaks everything down in to a cluster of info, but the overhead (and space) taken up by that is much larger. You should really get comfortable with string formatting and conversion using the single string scan VIs from the other posts above.
I don't understand the other proposed sultions at all and can not figure out how to apply them to my situation.
I can not even figure out how to get your snippet into a block diagram without it just being a picture.
09-04-2015 06:58 AM
It literally is two primatives and a string constant. Here is the VI.
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
16 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord