• Home
  • Jobs
  • Courses
  • Questions
  • Teachers
  • For business
  • ES/EN

0

9
Views
Javascript. Get start of local day timestamp based on local day string

In Javascript (NodeJs),

I receive a local date string (ex: "Wed 15 December") and I need to get the UTC timestamp of the start and end of this local day.

My webserver time is UTC.

For example, if the timezone is UTC+1, passing "Wed 15 December", I should get 1639522800000 timestamp for the day start time, and 1639609199000 for the day end time.

I haven't yet found any way to do this. I see people using momentjs or other libraries but it is not very clear.

I also need to get the start and end UTC timestamps of other moments, such as the start/end of the local month.

Thank you

about 1 month ago ·

Juan Pablo Isaza

Answer question
Find remote jobs
Loading

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post job Plans Our process Sales
Legal
Terms and conditions Privacy policy
© 2022 PeakU Inc. All Rights Reserved.