Date Constructor
Date
Creates a new Date object.Static Methods
Date.now
Returns current timestamp in milliseconds.Date.parse
Parses a date string and returns timestamp.Date.UTC
Returns UTC timestamp from date components.Get Methods (Local Time)
getFullYear
Returns the year.getMonth
Returns the month (0-11).getDate
Returns the day of month (1-31).getDay
Returns the day of week (0-6, Sunday = 0).getHours
Returns the hours (0-23).getMinutes
Returns the minutes (0-59).getSeconds
Returns the seconds (0-59).getMilliseconds
Returns the milliseconds (0-999).getTime
Returns the timestamp in milliseconds.getTimezoneOffset
Returns the timezone offset in minutes.Get Methods (UTC)
getUTCFullYear
Returns the UTC year.getUTCMonth
Returns the UTC month (0-11).getUTCDate
Returns the UTC day of month.getUTCDay
Returns the UTC day of week.getUTCHours
Returns the UTC hours.getUTCMinutes
Returns the UTC minutes.getUTCSeconds
Returns the UTC seconds.getUTCMilliseconds
Returns the UTC milliseconds.Set Methods (Local Time)
setFullYear
Sets the year.setMonth
Sets the month.setDate
Sets the day of month.setHours
Sets the hours.setMinutes
Sets the minutes.setSeconds
Sets the seconds.setMilliseconds
Sets the milliseconds.setTime
Sets the timestamp.Set Methods (UTC)
setUTCFullYear
Sets the UTC year.setUTCMonth
Sets the UTC month.setUTCDate
Sets the UTC day of month.setUTCHours
Sets the UTC hours.setUTCMinutes
Sets the UTC minutes.setUTCSeconds
Sets the UTC seconds.setUTCMilliseconds
Sets the UTC milliseconds.String Conversion Methods
toString
Returns string representation.toISOString
Returns ISO 8601 string.toDateString
Returns date portion as string.toTimeString
Returns time portion as string.toUTCString
Returns UTC string.toJSON
Returns JSON representation (same as toISOString).Usage Examples
Date Arithmetic
Date Formatting
Time Differences
See Also
- Math Built-ins - Mathematical operations
- Global Functions - parseInt, parseFloat
- ByteString Utilities - String formatting helpers