How can I use `javascript` to convert UTC to local time when receiving a datetime string from the server?

The server sends a UTC datetime in this format: 6/29/2011 4:52:48 PM, and I want to display it in the user’s local time zone. What’s the best way to achieve this using JavaScript or jQuery?

I’ve been working with frontend dashboards for years, and sometimes you just need a quick fix that works.

Answer 1: Native JavaScript Date Object (Quick & Easy) When I need a quick solution to javascript convert utc to local time, the native Date object does the trick:

const utcDateStr = "6/29/2011 4:52:48 PM";
const localDate = new Date(utcDateStr + " UTC");
console.log(localDate.toString()); // Local time output

I use this approach in lightweight apps or admin panels where simplicity matters more than full formatting control. It’s fast, no setup needed, and works well for most use cases.

Yeah, I’ve used @joe-elmoufak’s method too, but when I needed the output to be more user-facing and readable, I took it a step further.

Answer 2: Displaying in Local Format (More User-Friendly Output) Building on what Tom shared—once you’ve used native JS to handle javascript convert utc to local time, you can make it more human-readable with toLocaleString():

const utcDateStr = "6/29/2011 4:52:48 PM";
const localDate = new Date(utcDateStr + " UTC");
console.log(localDate.toLocaleString()); // "6/29/2011, 9:52:48 PM" (based on user’s locale)

I integrated this into a booking system so that users could see their local appointment time directly, without needing to figure it out themselves. It feels intuitive and user-first.

I’ve worked on SaaS products for global audiences, and when things got timezone-heavy, I knew I had to step it up.

Answer 3: Using Luxon for Precise Control When native JS falls short for more complex scenarios, like handling daylight savings or custom time zones, I reach for Luxon. It makes javascript convert utc to local time far more reliable:

// Include Luxon via CDN or npm
const { DateTime } = luxon;

const utcDateStr = "6/29/2011 4:52:48 PM";
const local = DateTime.fromFormat(utcDateStr, "M/d/yyyy h:mm:ss a", { zone: "utc" }).setZone("local");
console.log(local.toString());

This was a lifesaver in one of my enterprise dashboards, where customers across continents needed precision. Less guesswork, more clarity.