Logo

Programming-Idioms

History of Idiom 98 > diff from v18 to v19

Edit summary for version 19 by 1.7.4:
[JS] corrected things

Version 18

2019-01-24, 12:31:51

Version 19

2019-01-24, 12:33:12

Idiom #98 Epoch seconds to date object

Convert a timestamp ts (number of seconds in epoch-time) to a date with time d. E.g. 0 -> 1970-01-01 00:00:00

Idiom #98 Epoch seconds to date object

Convert a timestamp ts (number of seconds in epoch-time) to a date with time d. E.g. 0 -> 1970-01-01 00:00:00

Code
new Date (ts)
Code
new Date (ts * 1000)
Comments bubble
JavaScript is big on type conversion.
Comments bubble
JavaScript is big on type conversion.
Date is back from the olden days where we ripped our stuff from Java instead of Python :3