0

rc-time-picker在我的 React 应用程序中使用包让用户在 24 小时内选择所需的时间,但是RangeError: Invalid time value在使用以下内容时我收到了date-fns format

日期格式为:

"startTime": "2021-06-04T07:38:54.000Z"

<TableCell align="right">{format(startTime, 'HH:mm:ss')}</TableCell>

我收到以下错误:

var originalDate = toDate(dirtyDate);    
if (!isValid(originalDate)) {
    throw new RangeError('Invalid time value');
} // Convert the date in system timezone to the same date in UTC+00:00 timezone.
// This ensures that when UTC functions will be implemented, locales will be compatible with them.
// See an issue about UTC functions: https://github.com/date-fns/date-fns/issues/376
4

0 回答 0