getTimePickerTime
A utility method to get a time-picker time string in 24-hour format from a Date object, timestamp in ms, or a valid date/time string. By default, the time string will reflect the client's local time for the provided date. An optional IANA timeZone string can be provided to adjust the resulting time string to reflect the local time in the provided timeZone at that point in time.
getTimePickerTime('2024-03-29T17:00:00.000Z', 'America/New_York')
// => 13:00:00
(eastern)
getTimePickerTime('2024-03-29T17:00:00.000Z', 'America/Los_Angeles')
// => 10:00:00
(pacific)
Parameters
Returns
a time-picker time string in 24-hour format, e.g. 13:00:00
string
Function defined in common/src/utils/date/getTimePickerTime.ts:19