Getting day of week for different timezone using JavaScript

I’m currently located in Asia and need to figure out what day of the week it is right now in a European country using JavaScript. Specifically, I want to check the current weekday in the Helsinki timezone while my local time is completely different.

I’ve been trying to work with timezone conversions but I’m not sure about the best approach. Should I use the Date object with timezone parameters or is there a better method? I know the timezone identifier is ‘Europe/Helsinki’ but I’m not sure how to implement this properly.

Any suggestions for a clean solution would be really helpful. Thanks in advance!

The most straightforward approach is using the toLocaleDateString() method with timezone options. You can pass the timezone identifier directly to get the localized date information.

Here’s what works well in practice:

const helsinkiDate = new Date().toLocaleDateString('en-US', {
    timeZone: 'Europe/Helsinki',
    weekday: 'long'
});
console.log(helsinkiDate); // Returns the day name

If you need the day as a number instead, you can use getDay() on a date object that’s been adjusted for the timezone. The key thing to remember is that toLocaleDateString() handles the timezone conversion automatically, so you don’t need to manually calculate offsets or worry about daylight saving time changes.

This method is supported in all modern browsers and handles edge cases where the day might be different due to significant timezone differences between Asia and Europe.

honestly just use new Date().toLocaleString('fi-FI', {timeZone: 'Europe/Helsinki'}) and extract the day part. much simpler than those complex formatters imo. works perfectly for timezone conversions without overthinking it

I ran into a similar situation when building an application that needed to handle multiple timezones simultaneously. The approach I settled on uses Intl.DateTimeFormat which gives you more control over the formatting and is generally more reliable than toLocaleDateString(). javascript const formatter = new Intl.DateTimeFormat('en-US', { timeZone: 'Europe/Helsinki', weekday: 'long' }); const dayName = formatter.format(new Date()); console.log(dayName); This method has better browser compatibility and handles edge cases more consistently. If you need the numeric value (0-6), you can create a simple mapping or use weekday: 'short' and then convert it. The main advantage is that Intl.DateTimeFormat was specifically designed for internationalization scenarios like yours, whereas toLocaleDateString() can sometimes behave unexpectedly across different browsers when dealing with timezone conversions.