8 lines
249 B
JavaScript
8 lines
249 B
JavaScript
|
import { utcToZonedTime, format } from 'date-fns-tz';
|
||
|
|
||
|
export function convertToAmsterdamTime(date) {
|
||
|
const timeZone = 'Europe/Amsterdam';
|
||
|
const zonedDate = utcToZonedTime(date, timeZone);
|
||
|
return format(zonedDate, 'HH:mm:ss', { timeZone });
|
||
|
}
|