diff --git a/util/convertDateToISOString.js b/util/convertDateToISOString.js new file mode 100644 index 0000000..764c279 --- /dev/null +++ b/util/convertDateToISOString.js @@ -0,0 +1,3 @@ +module.exports = function (date){ + return date.getUTCFullYear() + '-' + ('0' + (date.getUTCMonth()+1)).slice(-2) + '-' + ('0' + date.getUTCDate()).slice(-2)+" "+date.getUTCHours()+":"+date.getUTCMinutes()+":"+date.getUTCSeconds(); +} \ No newline at end of file diff --git a/util/getCreationDate.js b/util/getCreationDate.js index 2bb9472..fa15199 100644 --- a/util/getCreationDate.js +++ b/util/getCreationDate.js @@ -1,4 +1,5 @@ +const convertDateToISOString = require("./convertDateToISOString"); module.exports = function(user){ let date = user.user.createdAt; - return date.getUTCFullYear() + '-' + ('0' + (date.getUTCMonth()+1)).slice(-2) + '-' + ('0' + date.getUTCDate()).slice(-2)+" "+date.getUTCHours()+":"+date.getUTCMinutes()+":"+date.getUTCSeconds(); + return convertDateToISOString(date); } \ No newline at end of file diff --git a/util/getJoinDate.js b/util/getJoinDate.js index e61a3ea..20cfc32 100644 --- a/util/getJoinDate.js +++ b/util/getJoinDate.js @@ -1,5 +1,6 @@ +const convertDateToISOString = require("./convertDateToISOString"); module.exports = function(user, guild){ const member = guild.member(user) let date = member.joinedAt; - return date.getUTCFullYear() + '-' + ('0' + (date.getUTCMonth()+1)).slice(-2) + '-' + ('0' + date.getUTCDate()).slice(-2)+" "+date.getUTCHours()+":"+date.getUTCMinutes()+":"+date.getUTCSeconds(); + return convertDateToISOString(date) } \ No newline at end of file