updated timezone
This commit is contained in:
parent
e9a4bfe264
commit
dc9cb2a8d9
Binary file not shown.
Before Width: | Height: | Size: 1.9 MiB After Width: | Height: | Size: 1.9 MiB |
12
src/index.js
12
src/index.js
|
@ -26,6 +26,8 @@ const client = new Client({
|
|||
|
||||
const config = JSON.parse(fs.readFileSync(path.resolve("config", "config.json")));
|
||||
|
||||
process.env.TZ = config.timezone;
|
||||
|
||||
client.once(Events.ClientReady, readyClient => {
|
||||
console.log(`Ready! Logged in as ${readyClient.user.tag}`);
|
||||
});
|
||||
|
@ -70,9 +72,7 @@ client.on('ready', () => {
|
|||
|
||||
console.log("Updating on boot");
|
||||
|
||||
let date = new Date().toISOString().
|
||||
replace(/T/, ' '). // replace T with a space
|
||||
replace(/\..+/, '')
|
||||
let date = new Date().toLocaleString('th-TH');
|
||||
|
||||
let caption = `# Weather Update\n## ${date}\n${radar_caption}`
|
||||
|
||||
|
@ -107,11 +107,9 @@ client.on('ready', () => {
|
|||
await channel.messages.delete(message_id);
|
||||
console.log("Delete old message");
|
||||
|
||||
let date = new Date().toISOString().
|
||||
replace(/T/, ' '). // replace T with a space
|
||||
replace(/\..+/, '')
|
||||
let date = new Date().toLocaleString('th-TH');
|
||||
|
||||
let caption = `# Weather Update\n## ${date} Asia/Bangkok\n${radar_caption}`
|
||||
let caption = `# Weather Update\n## ${date}\n${radar_caption}`
|
||||
|
||||
let message = await channel.send({
|
||||
content: caption,
|
||||
|
|
Loading…
Reference in New Issue