How to convert Date/Time tag into UNIX time stamp?

Started by mosdubindi1, April 11, 2025, 07:04:57 PM

Previous topic - Next topic

mosdubindi1

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

Mario

#1
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?

mosdubindi1