How to get the start time of the stream (french time)?

Hello, I would like to know how to get the start date of my streams but in French time version because I managed to find the “started_at” but it’s not the French time

You can simply use your favourite Date/Time Library’s function to convert it to any timezone you’d like.

The returned value is always in UTC+0 (currently), so (currently) you’d just need to add 2 hours to it. That obviously changes with Daylight Savings Time, so I highly recommend just using a Date/Time library.

Relevant: https://youtu.be/-5wpm-gesOY

ok thx, but how can I do that, it is for my discord bot (i’m using javascript (nodejs))

Just pass the time as is from the API to the discord Webhook/Embed, then Discord will display the embed with the discord client users timezone anyway.

No real need for you to convert it before passing it to Discord, as you can just pass UTC to discord and discord client will convert.

nodeJS I used to recommend moment.js (https://momentjs.com/) but they are closing in favour of Luxon https://moment.github.io/luxon/

no it doesn’t display correctly, that’s why I come to ask here.

image

Then you have a Discord problem not a Twitch problem

An example

What I see

What someone else sees

image

I’m using “timestamp” not “setFooter”, I also hand construct and send to a Discord WebHook rather than using a lib

setFooter won’t do the client side conversion since it’s JUST a string

So you probably want .setTimestamp() instead https://discordjs.guide/popular-topics/embeds.html#using-the-richembedmessageembed-constructor

.setTimestamp(r.data.data[0].started_at)

1 Like

ok I will try with timestamp

thanks a lot ! It works !!

1 Like