Skip to content

Commit c20790b

Browse files
thomasyzy7Austin-Xminhhaitran08kevin-lannMasahisaSekita
authored
Hotfix/1.0.6 - develop (#145)
Co-authored-by: Austin-X <[email protected]> Co-authored-by: minhhaitran08 <[email protected]> Co-authored-by: kevin-lann <[email protected]> Co-authored-by: Masahisa Sekita <[email protected]> Co-authored-by: Dmitriy Prokopchuk <[email protected]> Co-authored-by: Austin-X <[email protected]> Co-authored-by: dawangk <[email protected]> Co-authored-by: kevin-lann <[email protected]> Co-authored-by: MasahisaSekita <[email protected]>
1 parent bf8d4c4 commit c20790b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

course-matrix/backend/src/utils/convert-time-string.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,16 @@ export function convertTimeStringToDate(timeString: string): Date {
1616
date.setSeconds(seconds);
1717
date.setMilliseconds(0);
1818

19-
return date;
19+
// Convert to EDT (GMT-4)
20+
// First get the UTC time by adding the local timezone offset
21+
const utcDate = new Date(date.getTime() + date.getTimezoneOffset() * 60000);
22+
23+
// Then subtract 4 hours for EDT
24+
const edtOffset = -4 * 60 * 60000;
25+
const edtDate = new Date(utcDate.getTime() + edtOffset);
26+
27+
console.log("Original date:", date);
28+
console.log("EDT date:", edtDate);
29+
30+
return edtDate;
2031
}

0 commit comments

Comments
 (0)