cancel
Showing results for 
Search instead for 
Did you mean: 

file date created

ip
Member
Member

file date created

How to find the date created from a file?
11 REPLIES 11
Ray.R
Knight of NI

Re: file date created

You'll have to give more details about what you want to do...

Do you mean that you want to know when a file was created? As in (Windows) right click the file, choose properties and you get the size and datestamp of the file???

Or do you have a datestamp imbedded somewhere in a file and you want to parse through it using labview to find out when the data was stored???

Or do you have a database and you want to retrieve information related to a date?

Or.... wow... too many possibilities...

let's start from the top.

What do you want to find out about the date and why?

Help us help you by giving more details..

Thanks Smiley Surprised)

-JLV-
EdDickens
Active Participant

Re: file date created

Message contains an attachment
The attached library make a call to a Windows dll to grab file properties, including the file creation date. Of course this only works on Windows.

It's in LabVIEW 6.0.2, but upgrades OK.

Ed


Ed Dickens - Certified LabVIEW Architect
Lockheed Martin Space
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Dennis_Knutson
Knight of NI

Re: file date created

Do you want something else besides what the File/Directory Info function (on File I/O>Advanced File Functions) provides?
Oleg
Active Participant

Re: file date created

Hi,
if you need to know the last modification date of file then you can use
"Functions->File I/O->Advanced File Functions->File/Directory Info.vi"
This vi returns the value of file's last modification date. This is returned as U32 number. To see it in MM/DD/YY format you must create the indicator, right-click on it and select "Format & Precision..." item from drop-down menu. Then select "Time and Date" format there.

Good luck.

Oleg Chutko.
Highlighted
D4N!3L3
Member

Re: file date created

Thank You! Exactly what I'm searching for!

Your VI is still useful after 14 years :-D congratulations! Maybe it's time for NI to add this to regular features of LV??? At least in NXG...

D4N!3L3
Member

Re: file date created

...and now LabVIEW supports 64 bit integers Smiley Happy

Re: file date created

Message contains an attachment

I made several improvements bringing this up to modern best practices (or my current opinion of them).

 

Also, I think there was a bug in how the file size was being converted for files larger than 2^32 bytes. I fixed that.

 

Times are now output as timestamps and are local time, previously UTC.

 

A more sensible error code, error 6 (generic file I/O error), is used in two places with different error messages indicating the DLL function call that gave the error.

CircuitRF
Member

Re: file date created

Thanks for the VI.  Tried this with LV 2010 and it loads and runs fine but gives the incorrect date / time.  Also, is not in LV time stamp data type.  

RTSLVU
Trusted Enthusiast

Re: file date created

Message contains a hyperlink

@D4N!3L3 wrote:

Thank You! Exactly what I'm searching for!

Your VI is still useful after 14 years congratulations! Maybe it's time for NI to add this to regular features of LV??? At least in NXG...


NI will not be adding anything to NXG

 

tldr: 

The final release of LabVIEW NXG was LabVIEW NXG 5.1 in 2021.

NI will not release new versions of LabVIEW NXG after LabVIEW NXG 5.1.

========================
=== Engineer Ambiguously ===
========================