Converts a date or date string to a UTC Date object.
Prefer createDateForTimeZone if you have a specific time zone and can provide the date time string format (e.g. '2022-10-14').
createDateForTimeZone
The date or date string to convert.
The IANA time zone name to use for the conversion. Defaults to the system time zone.
The converted UTC Date object.
Converts a date or date string to a UTC Date object.
Prefer
createDateForTimeZoneif you have a specific time zone and can provide the date time string format (e.g. '2022-10-14').