Open 0xR opened 4 years ago
For example Amsterdam time before July 1937 is GMT +0h 19m 32.13s.
GMT +0h 19m 32.13s
This means you get a partial minute which does not seem valid.
Example:
import { formatToTimeZone } from 'date-fns-timezone'; console.log( formatToTimeZone(new Date(1937, 0), 'YYYY-MM-DDZ', { timeZone: 'Europe/Amsterdam', }), );
Gives: 1937-01-01+00:19.533333333333335
1937-01-01+00:19.533333333333335
My current workaround is rather pragmatic:
function roundAmsterdamTime(awsDate: string): string { return awsDate.replace(/:19\.5.*/, ':20'); }
For example Amsterdam time before July 1937 is
GMT +0h 19m 32.13s
.This means you get a partial minute which does not seem valid.
Example:
Gives:
1937-01-01+00:19.533333333333335