breakhours-transform/api/utils.js

8 lines
249 B
JavaScript
Raw Permalink Normal View History

2024-10-03 11:55:18 +00:00
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 });
}