MCPcopy Index your code
hub / github.com/OpenSignLabs/OpenSign / formatTimeInTimezone

Function formatTimeInTimezone

apps/OpenSign/src/constant/Utils.js:3687–3693  ·  view source on GitHub ↗
(date, timezone)

Source from the content-addressed store, hash-verified

3685
3686// Format date and time for the selected timezone
3687export const formatTimeInTimezone = (date, timezone) => {
3688 const nyDate = timezone && toZonedTime(date, timezone);
3689 const generatedDate = timezone
3690 ? format(nyDate, "EEE, dd MMM yyyy HH:mm:ss zzz", { timeZone: timezone })
3691 : new Date(date).toUTCString();
3692 return generatedDate;
3693};
3694
3695// `usertimezone` is used to get timezone of current user
3696export const usertimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;

Callers 1

formatDateTimeFunction · 0.70

Calls 1

formatFunction · 0.85

Tested by

no test coverage detected