0

Not looking for the environment-specific date methods like this for calculating these date fields, but how do you isolate them from a Unix timestamp such as now, which was 1650045773120? It is in milliseconds from Jan 1 1970 UTC, but I'm not sure how to do the conversion to isolate these values. If there are links to source code which already show the implementation, that would work too.

const start = new Date(0)
const now = Date.now()

This seems like it will be fairly complex, so wondering how JodaTime or the JavaScript Date implement this under the hood, and perhaps where the source code is. Unless you know how to do it directly.

Ole V.V.
  • 81,772
  • 15
  • 137
  • 161
Lance
  • 75,200
  • 93
  • 289
  • 503
  • Trying to learn from [this](https://stackoverflow.com/questions/35379513/convert-unix-time-to-month-number) and perhaps [this](https://gist.github.com/t3hk0d3/6186590), but looking for a somewhat optimal approach. – Lance Apr 15 '22 at 18:13
  • Was the Joda-Time or the java.time source code hard to find? – Ole V.V. Apr 17 '22 at 17:57

0 Answers0