breakhours-transform/api/utils.js
2024-10-03 13:55:18 +02:00

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 });
}