Converts date to ISO 8601 format string (standard format for APIs and data interchange). Example: Date(2024,0,15,14,30,45) → '2024-01-15T14:30:45.000Z'
a date
date as string
Converts date to JSON-compatible string (same as ISO format, used in JSON.stringify). Example: Date(2024,0,15,14,30) → '2024-01-15T14:30:00.000Z'
a date
date as string
Converts date to full locale-specific string (includes date, time, and timezone). Example: Date(2024,0,15,14,30) → 'Mon Jan 15 2024 14:30:00 GMT+0000'
a date
date as string
Converts date to time string (excludes date, includes timezone). Example: Date(2024,0,15,14,30,45) → '14:30:45 GMT+0000'
a date
time as string
Converts date to UTC string format (Universal Coordinated Time, no timezone offset). Example: Date(2024,0,15,14,30) → 'Mon, 15 Jan 2024 14:30:00 GMT'
a date
date as utc string
Creates a new date from individual components using local time. Month is 0-indexed: 0=January, 11=December. Example: year=2024, month=0, day=15, hours=14, minutes=30 → Date(Jan 15, 2024 14:30)
a date
date
Creates a new date from individual components using UTC (ignores timezone). Returns milliseconds since Unix epoch (Jan 1, 1970 00:00:00 UTC). Example: year=2024, month=0, day=15 → Date representing Jan 15, 2024 00:00 UTC
a date
date
Creates a date from Unix timestamp (milliseconds since Jan 1, 1970 UTC). Example: unixTimeStamp=1705329000000 → Date(Jan 15, 2024 14:30:00)
a unix time stamp
date
Extracts day of the month from date (1-31) using local time. Example: Date(2024,0,15) → 15
date
Extracts day of the week from date (0=Sunday, 6=Saturday) using local time. Example: Date(2024,0,15) → 1 (Monday)
day
Extracts full year from date using local time. Example: Date(2024,0,15) → 2024
year
Extracts month from date (0=January, 11=December) using local time. Example: Date(2024,0,15) → 0 (January)
month
Extracts hours from date (0-23) using local time. Example: Date(2024,0,15,14,30) → 14
hours
Extracts minutes from date (0-59) using local time. Example: Date(2024,0,15,14,30) → 30
minutes
Extracts seconds from date (0-59) using local time. Example: Date(2024,0,15,14,30,45) → 45
seconds
Extracts milliseconds from date (0-999) using local time. Example: Date(2024,0,15,14,30,45,123) → 123
milliseconds
Converts date to Unix timestamp (milliseconds since Jan 1, 1970 UTC). Example: Date(2024,0,15,14,30) → 1705329000000
time
Extracts full year from date using UTC (ignores timezone). Example: Date(2024,0,15) → 2024
year
Extracts month from date (0=January, 11=December) using UTC. Example: Date.UTC(2024,0,15) → 0 (January)
month
Extracts day of the month from date (1-31) using UTC. Example: Date.UTC(2024,0,15) → 15
day
Extracts hours from date (0-23) using UTC. Example: Date.UTC(2024,0,15,14) → 14
hours
Extracts minutes from date (0-59) using UTC. Example: Date.UTC(2024,0,15,14,30) → 30
minutes
Extracts seconds from date (0-59) using UTC. Example: Date.UTC(2024,0,15,14,30,45) → 45
seconds
Extracts milliseconds from date (0-999) using UTC. Example: Date.UTC(2024,0,15,14,30,45,123) → 123
milliseconds
Parses a date string and returns Unix timestamp (milliseconds since Jan 1, 1970 UTC). Example: dateString='2024-01-15' → 1705276800000
a date string
the number of milliseconds between that date and midnight, January 1, 1970.
Creates new date with modified year (returns new date, original unchanged). Example: Date(2024,0,15) with year=2025 → Date(2025,0,15)
a date and the year
date
Creates new date with modified month (0=January, 11=December, returns new date). Example: Date(2024,0,15) with month=5 → Date(2024,5,15) (June 15)
a date and the month
date
Creates new date with modified day of month (1-31, returns new date). Example: Date(2024,0,15) with day=20 → Date(2024,0,20)
a date and the day
date
Sets the hour value in the Date object using local time.
a date and the hours
date
Sets the minutes value in the Date object using local time.
a date and the minutes
date
Sets the seconds value in the Date object using local time.
a date and the seconds
date
Sets the milliseconds value in the Date object using local time.
a date and the milliseconds
date
Sets the date and time value in the Date object.
a date and the time
date
Sets the year value in the Date object using Universal Coordinated Time (UTC).
a date and the year
date
Sets the month value in the Date object using Universal Coordinated Time (UTC).
a date and the month
date
Sets the numeric day of the month in the Date object using Universal Coordinated Time (UTC).
a date and the day
date
Sets the hours value in the Date object using Universal Coordinated Time (UTC).
a date and the hours
date
Sets the minutes value in the Date object using Universal Coordinated Time (UTC).
a date and the minutes
date
Sets the seconds value in the Date object using Universal Coordinated Time (UTC).
a date and the seconds
date
Sets the milliseconds value in the Date object using Universal Coordinated Time (UTC).
a date and the milliseconds
date
Converts date to human-readable date string (excludes time). Example: Date(2024,0,15,14,30) → 'Mon Jan 15 2024'