Skip to content

Commit

Permalink
timezone: rev video
Browse files Browse the repository at this point in the history
  • Loading branch information
leifermendez committed Mar 26, 2024
1 parent b78f230 commit 678e40d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/utils/currentDate.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { format } from 'date-fns'
import { utcToZonedTime } from 'date-fns-tz';

const TIME_ZONE = process.env.TZ

const getFullCurrentDate = (): string => {
const currentD = new Date();
const formatDate = format(currentD, 'yyyy/MM/dd HH:mm'); // Formato "dd/MM/yyyy HH:mm:ss"
const day = format(currentD, 'EEEE'); // Obtener el día de la semana
const formatDate = format(utcToZonedTime(currentD, TIME_ZONE), 'yyyy/MM/dd HH:mm');
const day = format(utcToZonedTime(currentD, TIME_ZONE), 'EEEE');

return [
formatDate,
Expand Down

0 comments on commit 678e40d

Please sign in to comment.