For these examples, date is set using
var now=new Date()when local time was
- a number representing the month, 0 for January, 1 for February, ... You can use this as a key to an array of month names or add one to the number to get a human readable month
- the day of the month as a number from 1 to 31
- the day of the week as a number from 0 to 6 where 0 represents Sunday and 6 represents Saturday
- returns the four digit year
- returns the two digit year OR the four digit year minus 1900, you should probably avoid using this in favor of getFullYear()
now.getYear()RESULT: 07 OR 107 OR even 7
- hour of the day on a 24 hour clock (0 to 23)
- minutes after the hour (0 to 59)
- seconds of the minute (0 to 59)
- millionths of a second (0 to 999)
- Offset from UTC time in minutes
This site needs an editor - click to learn more!
You Should Also Read:
Editor's Picks Articles
Top Ten Articles
Content copyright © 2019 by Julie L Baumler. All rights reserved.
This content was written by Julie L Baumler. If you wish to use this content in any manner, you need written permission. Contact BellaOnline Administration for details.