UNPKG

629 BJavaScriptView Raw
1import { createLocalOrUTC } from './from-anything';
2import { isDate } from '../utils/type-checks';
3export function parseDate(input, format, localeKey, strict, isUTC) {
4 if (isDate(input)) {
5 return input;
6 }
7 const config = createLocalOrUTC(input, format, localeKey, strict, isUTC);
8 return config._d;
9}
10export function utcAsLocal(date) {
11 if (!(date instanceof Date)) {
12 return null;
13 }
14 return new Date(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), date.getUTCMilliseconds());
15}
16//# sourceMappingURL=local.js.map
\No newline at end of file