LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

file date created

How to find the date created from a file?
Message 1 of 12
(10,506 Views)
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 🐵

-JLV-
Message 2 of 12
(10,506 Views)
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 - DISTek Integration, Inc. - NI Certified Alliance Partner
Using the Abort button to stop your VI is like using a tree to stop your car. It works, but there may be consequences.
Message 3 of 12
(10,507 Views)
Do you want something else besides what the File/Directory Info function (on File I/O>Advanced File Functions) provides?
Message 4 of 12
(10,507 Views)
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.
Message 5 of 12
(10,507 Views)

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...

0 Kudos
Message 6 of 12
(6,631 Views)

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

0 Kudos
Message 7 of 12
(6,625 Views)

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.

0 Kudos
Message 8 of 12
(2,643 Views)

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.  

0 Kudos
Message 9 of 12
(2,064 Views)

@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 ===
========================
0 Kudos
Message 10 of 12
(2,048 Views)