0

I want to get the current year, month, day, hour, minute second, and millisecond in javascript.

I am also using p5.js, if that has any helper methods.

This is what I want:

Year=2018

Month=4

Day=20

Hour=10

Minute=15

Second=25

Millisecond=236
Vega
  • 27,856
  • 27
  • 95
  • 103
mackycheese21
  • 884
  • 1
  • 9
  • 24

2 Answers2

2

Questions like this are best answered by reading through the P5.js reference.

Specifically, look at the Time and Date section, which lists exactly the functions you're looking for.

Kevin Workman
  • 41,537
  • 9
  • 68
  • 107
1

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

This site has the link, courtesy of @tkausl.

mackycheese21
  • 884
  • 1
  • 9
  • 24