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

ArgumentTypeDescription
yearNumberThe year for the new date
monthNumber(Optional) The month for the new date, defaults to 1 (January)
dayNumber(Optional) The day for the new date, defaults to 1
hoursNumber(Optional) The hours for the new date, defaults to 0 (midnight)
minutesNumber(Optional) The minutes for the new date, defaults to 0
secondsNumber(Optional) The seconds for the new date, defaults to 0
millisecondsNumber(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