Every Time Zone Bot

Hello!
I Want To Create A Bot Whos Writeing Every Min (Or Sec) The Clock In Every Time Zone
Like
16:18:10
GMT+2 (UTC+2)
But I Not Good At Discord.js Someone Can Help Me And Give Me Code At Discord?
MegaNoamSuper#7584
Thanks Arnon

All you would have to do use the JavaScript functions for time like, getHours() and getMinutes(). Then you would have to subtract one hour for each time zone to the left of you and so on.

Assuming you live in EST and you want to get CST:
var time = getHours() - 1
message.channel.send("The time in CST is " + time);

1 Like

Can You Do For Me Code For This?

and I Going To need Somethink Else

I’m not so sure you’ll learn anything if someone spoon feeds all the code to you…

5 Likes

i have the start code
but how i setting this?

Here’s a tutorial video made by Glitch over at: https://www.youtube.com/watch?v=uv0hcWw7jdA
Project URL: https://starter-discord.glitch.me/

What is the code you currently have, I recommend you have a look at how to ask.

3 Likes

What is Your Discord I’ll send The Code To The Discord?

It’s better if you send it here, maybe if I can’t help you someone else can.

Ok Dude i’m opening The Code And Send

That The Code


This Is Where I Check The Bot

the getHours function could perhaps be new Date().getUTCHours()

at Client. (/app/server.js:19:16)

7:26 PM

at Client.emit (events.js:196:13)

7:26 PM

at MessageCreateAction.handle (/rbd/pnpm-volume/3d11e9ef-fce3-4bd4-b3c4-37e6ddc8a6de/node_modules/.registry.npmjs.org/discord.js/12.2.0/node_modules/discord.js/src/client/actions/MessageCreate.js:31:14)

7:26 PM

at Object.module.exports [as MESSAGE_CREATE] (/rbd/pnpm-volume/3d11e9ef-fce3-4bd4-b3c4-37e6ddc8a6de/node_modules/.registry.npmjs.org/discord.js/12.2.0/node_modules/discord.js/src/client/websocket/handlers/MESSAGE_CREATE.js:4:32)

7:26 PM

at WebSocketManager.handlePacket (/rbd/pnpm-volume/3d11e9ef-fce3-4bd4-b3c4-37e6ddc8a6de/node_modules/.registry.npmjs.org/discord.js/12.2.0/node_modules/discord.js/src/client/websocket/WebSocketManager.js:386:31)

7:26 PM

at WebSocketShard.onPacket (/rbd/pnpm-volume/3d11e9ef-fce3-4bd4-b3c4-37e6ddc8a6de/node_modules/.registry.npmjs.org/discord.js/12.2.0/node_modules/discord.js/src/client/websocket/WebSocketShard.js:436:22)

7:26 PM

at WebSocketShard.onMessage (/rbd/pnpm-volume/3d11e9ef-fce3-4bd4-b3c4-37e6ddc8a6de/node_modules/.registry.npmjs.org/discord.js/12.2.0/node_modules/discord.js/src/client/websocket/WebSocketShard.js:293:10)

7:26 PM

at WebSocket.onMessage (/rbd/pnpm-volume/3d11e9ef-fce3-4bd4-b3c4-37e6ddc8a6de/node_modules/.registry.npmjs.org/ws/7.3.0/node_modules/ws/lib/event-target.js:125:16)

7:26 PM

at WebSocket.emit (events.js:196:13)

7:26 PM

at Receiver.receiverOnMessage (/rbd/pnpm-volume/3d11e9ef-fce3-4bd4-b3c4-37e6ddc8a6de/node_modules/.registry.npmjs.org/ws/7.3.0/node_modules/ws/lib/websocket.js:800:20)

7:26 PM
I’m Getting This Error

You can also base the code using UTC with .getUTCHours, etc then figure out then zone subtract/add to it do what you want with it.

1 Like

Literally what I said :joy:

1 Like

How I’m Fix The Error?

Someone? i need That Fast!!!

enable-pnpm

Try that in the console.