Mostafa
Mostafa

Reputation: 1

How to get date time format from javascript?

I want to display date of today according the current datetime format without displaying the seconds

Thanks for help

Upvotes: 0

Views: 1259

Answers (1)

Pointy
Pointy

Reputation: 413720

You have to write some code yourself to do it, or you could use a library like Date.js.

JavaScript "Date" object instances have methods like .getFullYear(), .getMonth(), .getDate(), and so on. (Be aware that .getMonth() returns numbers from 0 through 11, not 1 through 12.)

Upvotes: 2

Related Questions