Menu

gitpiper

fromTimestamp javascript Code Snippet in 2024

datebeginner

Last Updated: 5 May 2024

Creates a Date object from a Unix timestamp.

  • Convert the timestamp to milliseconds by multiplying with 1000.
  • Use new Date() to create a new Date object.
const fromTimestamp = timestamp => new Date(timestamp * 1000);
fromTimestamp(1602162242); // 2020-10-08T13:04:02.000Z

javascript snippet similar to fromTimestamp For You in May 2024

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️

© 2024 GitPiper. All rights reserved

Rackpiper Technology Inc

Company

About UsBlogContact

Subscribe to our Newsletter

Subscribe to get resources directly to your inbox. You won't receive any spam! ✌️