UTCDATE
Creates a date from the specified values.
Syntax
=UTCDATE(year)
=UTCDATE(year, month)
=UTCDATE(year, month, day)
=UTCDATE(year, month, day, hours)
=UTCDATE(year, month, day, hours, minutes)
=UTCDATE(year, month, day, hours, minutes, seconds)
=UTCDATE(year, month, day, hours, minutes, seconds, milliseconds)
Arguments
Argument | Type | Description |
---|---|---|
year | Number | The year for the new date |
month | Number | (Optional) The month for the new date, defaults to 1 (January) |
day | Number | (Optional) The day for the new date, defaults to 1 |
hours | Number | (Optional) The hours for the new date, defaults to 0 (midnight) |
minutes | Number | (Optional) The minutes for the new date, defaults to 0 |
seconds | Number | (Optional) The seconds for the new date, defaults to 0 |
milliseconds | Number | (Optional) The milliseconds for the new date, defaults to 0 |
Examples
In the following examples, the current browser has a timezone offset of -7 hours. For more information about offsets see UTC Offset.
=UTCDATE(2020)
→2019-12-31 17:00:00.000
Create a date with the year 2020, and defaults for all other values with the current browser timezone
=UTCDATE(2020, 2)
→2020-01-31 17:00:00.000
Create a date with the year 2020, the month 2, and defaults for all other values with the current browser timezone
=UTCDATE(2020, 2, 3)
→2020-02-02 17:00:00.000
Create a date with the year 2020, the month 2, the day 3, and defaults for all other values with the current browser timezone
=UTCDATE(2020, 2, 3, 4)
→2020-02-02 21:00:00.000
Create a date with the year 2020, the month 2, the day 3, the hours 4, and defaults for all other values with the current browser timezone
=UTCDATE(2020, 2, 3, 4, 5)
→2020-02-02 21:05:00.000
Create a date with the year 2020, the month 2, the day 3, the hours 4, the minutes 5, and defaults for all other values with the current browser timezone
=UTCDATE(2020, 2, 3, 4, 5, 6)
→2020-02-02 21:05:06.000
Create a date with the year 2020, the month 2, the day 3, the hours 4, the minutes 5, the seconds 6, and defaults for all other values with the current browser timezone
=UTCDATE(2020, 2, 3, 4, 5, 6, 7)
→2020-02-02 21:05:06.007
Create a date with the year 2020, the month 2, the day 3, the hours 4, the minutes 5, the seconds 6, the milliseconds 7, with the current browser timezone
Updated 7 months ago