fix/getDateEST
This commit is contained in:
2 files changed
+2
-2
No files matched your search
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "dayz-armbands",
|
||||
"version": "8.10.4",
|
||||
"version": "8.10.5",
|
||||
"description": "A General Purpose Discord Bot for DayZ Servers.",
|
||||
"main": "index.js",
|
||||
"nodemonConfig": {
|
||||
|
||||
@@ -107,7 +107,7 @@ class DayzArmbands extends Client {
|
||||
async getDateEST(time) {
|
||||
let t = new Date(); // Get current date (PST)
|
||||
let e = new Date(t.getTime() + 180*60*1000); // Convert to EST to ensure the date is correct for the applied EST time
|
||||
let n = new Date(`${e.getFullYear()}-${e.getMonth()<10?'0':''}${e.getMonth()+1}-${e.getDate()}T${time.split(' ')[0]}`) // Apply given time to EST date
|
||||
let n = new Date(`${e.getFullYear()}-${e.getMonth()<10?'0':''}${e.getMonth()+1}-${e.getDate()<10?'0':''}${e.getDate()}T${time.split(' ')[0]}`) // Apply given time to EST date
|
||||
let f = new Date(n.getTime() - 180*60*1000) // Convert back to PST
|
||||
return f;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user