How do I get the time of day in javascript/Node.js?

后端 未结 9 849
青春惊慌失措
青春惊慌失措 2020-12-23 13:23

I want to get 1 to 24, 1 being 1am Pacific Time.

How can I get that number in Node.JS?

I want to know what time it is in Pacific time right

9条回答
  •  孤城傲影
    2020-12-23 13:24

    Both prior answers are definitely good solutions. If you're amenable to a library, I like moment.js - it does a lot more than just getting/formatting the date.

提交回复
热议问题