Created
February 24, 2018 22:41
-
-
Save salwador/46f6de151757b333ab23ccb2470eafb9 to your computer and use it in GitHub Desktop.
getDate function for Bully Multiplayer 0.1.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const dayName = { | |
Mon: `Monday`, | |
Tue: `Tuesday`, | |
Wed: `Wednesday`, | |
Thu: `Thursday`, | |
Fri: `Friday`, | |
Sat: `Saturday`, | |
Sun: `Sunday`, | |
}; | |
const monthName = { | |
Jan: `January`, | |
Feb: `February`, | |
Mar: `March`, | |
Apr: `April`, | |
May: `May`, | |
Jun: `June`, | |
Jul: `July`, | |
Aug: `August`, | |
Sep: `September`, | |
Oct: `October`, | |
Nov: `November`, | |
Dec: `December` | |
}; | |
//////////////////////////////// | |
global.getDate = function () { | |
const date = Date().split(` `); | |
const time = date[4].split(`:`); | |
const day = dayName[date[0]], | |
month = monthName[date[1]], | |
monthday = parseInt(date[2]), | |
year = parseInt(date[3]), | |
hour = parseInt(time[0]), | |
minute = parseInt(time[1]), | |
second = parseInt(time[2]); | |
return { | |
day, month, monthday, year, minute, hour, second | |
}; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment