Add convertDateToISOString.js
Also make getCreationDate.js and getJoinDate.js use this function
This commit is contained in:
parent
8a47c78b44
commit
a1986c12a2
3 changed files with 7 additions and 2 deletions
3
util/convertDateToISOString.js
Normal file
3
util/convertDateToISOString.js
Normal file
|
@ -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();
|
||||||
|
}
|
|
@ -1,4 +1,5 @@
|
||||||
|
const convertDateToISOString = require("./convertDateToISOString");
|
||||||
module.exports = function(user){
|
module.exports = function(user){
|
||||||
let date = user.user.createdAt;
|
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);
|
||||||
}
|
}
|
|
@ -1,5 +1,6 @@
|
||||||
|
const convertDateToISOString = require("./convertDateToISOString");
|
||||||
module.exports = function(user, guild){
|
module.exports = function(user, guild){
|
||||||
const member = guild.member(user)
|
const member = guild.member(user)
|
||||||
let date = member.joinedAt;
|
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)
|
||||||
}
|
}
|
Loading…
Add table
Reference in a new issue