photools.com Community

IMatch Discussion Boards => General Discussion and Questions => Topic started by: mosdubindi1 on April 11, 2025, 07:04:57 PM

Title: How to convert Date/Time tag into UNIX time stamp?
Post by: mosdubindi1 on April 11, 2025, 07:04:57 PM
Hello Mario,

I did not find a formatting function, which allows to convert Date/Time tag into the UNIX time stamp. Is it possible to do somehow?

Thanks in advance,
Dmitry
Title: Re: How to convert Date/Time tag into UNIX time stamp?
Post by: Mario on April 12, 2025, 09:27:09 AM
UNIX timestamp as in seconds since January 01 1970?

I would say that with math and timediff, this could work, e.g.:

{File.DateTime|format:YYYY-MM-DD hh:mm:ss;math:timediff,1970-01-01 00:00:00}
Subtract the UNIX epoch from the File.DateTime and return results in seconds.
but there are some differences between the result of this and some online tools. Maybe time zone related?
Title: Re: How to convert Date/Time tag into UNIX time stamp?
Post by: mosdubindi1 on April 12, 2025, 11:21:44 AM
Thank you very much Mario, it works perfectly.