Skip to content

Commit

Permalink
fix(utils): 🐛 fix wrong used way of timezone
Browse files Browse the repository at this point in the history
  • Loading branch information
lehuygiang28 committed Jul 20, 2024
1 parent e82655b commit 79fc727
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/utils/common.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
import timezone from 'moment-timezone';
import { tz } from 'moment-timezone';
import crypto, { BinaryLike } from 'node:crypto';
import { RESPONSE_MAP } from '../constants/response-map.constant';
import { HashAlgorithm, VnpLocale } from '../enums';

export function getDateInGMT7(date?: Date): Date {
return timezone(date ?? new Date())
.tz('Asia/Ho_Chi_Minh')
.toDate();
return tz(date ?? new Date(), 'Asia/Ho_Chi_Minh').toDate();
}

/**
Expand Down

0 comments on commit 79fc727

Please sign in to comment.