Getting unix timestamp from Date() November 27, 2022 by Tarik getTime() retrieves the milliseconds since Jan 1, 1970 GMT passed to the constructor. It should not be too hard to get the Unix time (same, but in seconds) from that.