File Info

gavspav's picture

Hello to the forums.

I've been getting into QC and looking at some of the Betas.

I've been trying to use the FIle Info (Beta) Patch to detect which file in a folder is the most recent.

I have been struggling to understand the info from the Creation or Modification time pins.

When I use the Number Formatter I get dtata like 1,203,454,124 when I was expecting something like 19/02/2008 20:38

Do I need to interpret the data somehow?

Thanks

Gavin

cwright's picture
timestamp

The value returned is probably very strange to non-programmers: the number is the number of seconds since 1970 (or 2001, or something like that).

So, the oldest file will have the lowest number, while the newest file will have the highest number.

This makes comparing pretty easy (is date1 > date2?), but makes converting it into a "human" date (yyyy.mm.dd, dd/mm/yy, mm/dd/yy, etc) a bit more tricky.

dwskau's picture
Date Formatter

The date formatter patch should give human legible output.

gavspav's picture
The date is 31 years out!

The date is 31 years out! But the rest of it is right.

Good enough for me anyway - thanks alot both of you!

Gavin

cwright's picture
time warp

I'm guessing that's because the timestamps are from 1970, while the date formatter thinks they're from 2001 (a 31 year difference). You could subtract 31 years in seconds (978264705 seconds) before passing it to the date formatter for more accurate results.