Use the utc() method of moment to remove the timezone and display everything in universal time.

moment.utc('2015-01-22T16:11:36.36-07:00').format('l LT')

That will display the time as it is in UTC without any timezone offset. If you want to display the time as it was recorded in the user/server timezone you can parse the zone information when you construct a moment instance and have it use the timezone recorded in the parsed string.

moment.parseZone('2015-01-22T16:11:36.36-07:00').format('l LT');

With either of these approaches you should consider labeling the time in some way to reflect the timezone the time corresponds to. Failing to do this could lead to a lot of confusion for the end users.

Answer from musicfuel on Stack Overflow
🌐
Moment.js
momentjs.com › guides
Moment.js | Guides
The Moment.js core library provides functionality related to adjusting times based on an offset value. It does not provide support for adjusting dates based on time zone data - this is provided by the Moment TimeZone library.
🌐
GitHub
github.com › moment › moment › issues › 2788
Remove timezone from a moment.js object · Issue #2788 · moment/moment
December 4, 2015 - I'm using datetimepicker.js and its date function returns a moment.js object. It does so with the local UTC offset in it and my original date has a different offset. ... Note how I removed the +01 offset at the end. How can I do this applying it for any local UTC ? This is, without having to manually remove the 01 (as it can be a any other local offset depending on the user location).
Published   Dec 04, 2015
🌐
CopyProgramming
copyprogramming.com › howto › display-datetime-with-momentjs-without-timezone-conversion
Displaying datetime using momentjs while preserving original timezone - Javascript
June 14, 2023 - I quickly created this without utilizing momentjs, as it is no longer being maintained. const input = "07/26/2022 07:01:14 AM" const date= new Date(input); // VVVVVV timezone fix date.setMinutes(date.getMinutes() - date.getTimezoneOffset() + 5 * 60); // date is now "07/26/2022 07:01:14 AM GMT-5" // the following is just to show it's right const verifyDate = new Intl.DateTimeFormat(navigator.language, { dateStyle: 'full', timeStyle: 'full', timeZone: 'America/Bogota' // just picking a GMT-5 zone at random }).format(date); console.log(verifyDate) // at this point
🌐
Dawntraoz
dawntraoz.com › home › blog › how to format dates without moment.js
How to format dates without Moment.js - Dawntraoz
February 2, 2021 - But even though I have decided to use Date and Intl in my projects, I still have the itch to try out the library Spacetime. Spacetime is a solution without Intl that calculate time in remote timezones, support daylight savings, leap years, and hemispheres. I have to take a look at it and put it into practice 👀 Share with me your thoughts if you already tried it!! And, well, we've come to the end, we've to leave moment behind.
🌐
Moment.js
momentjs.com › timezone › docs
Moment Timezone | Docs
Note: By default, webpack bundles all moment-timezone data (in moment-timezone 0.5.25, that’s over 900 KBs minified). To strip out unwanted data and bundle only the zone and date range data you need, add the moment-timezone-data-webpack-plugin package:
🌐
GitHub
github.com › moment › moment › issues › 3455
How to represent dates (without time) and times (without date)? · Issue #3455 · moment/moment
September 19, 2016 - A related concept is that of a time of day (say, 9:30 AM). A time of day has no date or time zone attached to it. So storing a time of day as something like moment('0001-01-01T09:30+00:00') again seems rather hackish to me.
Published   Sep 19, 2016
Find elsewhere
Top answer
1 of 1
4

To meet the requirement you described (keeping the local time while changing the offset) you can do the following:

var result = moment.parseZone("2019-11-19T07:05:00+01:00").utcOffset(0, true).format();
console.log(result); //=> "2019-11-19T07:05:00Z"
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.24.0/moment.min.js"></script>

Step by step explained:

moment.parseZone("2019-11-19T07:05:00+01:00") // Parses the string, retaining the offset provided
      .utcOffset(0, true)  // sets the offset to zero while keeping the local time
      .format()            // formats the output, using Z to represent UTC

However - You should recognize that these are not the same moments in time. The output timestamp is one hour earlier than the input timestamp. This is explained in the documentation as follows (emphasis mine):

The utcOffset function has an optional second parameter which accepts a boolean value indicating whether to keep the existing time of day.

  • Passing false (the default) will keep the same instant in Universal Time, but the local time will change.

  • Passing true will keep the same local time, but at the expense of choosing a different point in Universal Time.

Thus, it is usually the wrong choice when you already have a specific point in time, either in UTC or as an offset from UTC (like your example input value).

Instead, you should expect that converting from local time to UTC will indeed change the date and time portion of the timestamp. You can use .utcOffset(0, false), or .utcOffset(0), or simply .utc() to do the conversion correctly.

🌐
Bobby Hadz
bobbyhadz.com › blog › javascript-create-date-without-timezone
How to Create a Date without Timezone in JavaScript | bobbyhadz
To create a Date without the timezone, we called the toISOString() method on the Date object and removed the character Z from the ISO string.
🌐
OpenReplay
blog.openreplay.com › common-date-time-operations-without-moment-js
Common date/time operations without Moment.js
Timezone support: Luxon has built-in support for working with time zones, including the ability to convert between time zones and to represent dates and times in a specific time zone.
🌐
GitHub
github.com › moment › moment › issues › 849
Switching timezone of moment without changing the values? · Issue #849 · moment/moment
June 16, 2013 - I want to change the timezone of the selected date without altering actual date and time selected by the user then of course I can convert it to UTC and send back to server. moment(selectedDate) //convert javascript date to moment moment.setTimezone('+0200') // this should change timezone keeping the date and time unchanged moment.utc().toJSON() //back to server ·
Published   Jun 16, 2013
🌐
DataTables
datatables.net › forums › discussion › 74120 › any-way-to-specify-format-to-moment-js-but-keep-local-timezone-adjustment
Any way to specify format to moment.js but keep local timezone adjustment? — DataTables forums
If I recall it correctly you will only have the automatic adjustment if you keep DataTable.render.datetime() without parameter. You will need a more complex renderer that allows you to use the output of DataTable.render.datetime() as an input parameter OR you adjust the input date format returned from the server to match your target format. https://datatables.net/examples/datetime/auto-locale-moment.html
🌐
Medium
medium.com › @AntonAntonov88 › understanding-time-zone-conversions-in-javascript-native-date-vs-moment-js-902ff37fe2b7
Understanding Time Zone Conversions in JavaScript: Native Date vs. Moment.js | by Anton Antonov | Medium
July 22, 2025 - In such cases, the API should return the time without a time zone. Example of a date-time format: “2024–01–22T15:30:00” · Since the date time string doesn’t include time zone information, the Native Date and each JS library such as ...
🌐
Reddit
reddit.com › r/programminghelp › using moment.js without having it transform the time to local time
r/programminghelp on Reddit: Using moment.js without having it transform the time to local time
October 15, 2020 -

Hi everyone,

I'm not familiar with javascript at all, only .Net and C++.

Here's the relevant piece of code that I'm working with:

this.timeStamp = moment('08:00', 'HHmm');

Of course, the time I put in isn't hardcoded but that's the exact format that the object I'm putting there contains. Every time.

Now, when I run this code, I receive an object containing the current date, information about my timezone (UTC+0300) and the time 11:00.

Judging from the documentation, this is seemingly normal behavior:

With Moment, the date is always interpreted as local time, unless you specify otherwise.

However, I can't seem to figure out how to specify otherwise. All I want is to create a moment-object that contains the exact time that I entered, not the time I entered + the offset from my local timezone.

It's probably a stupid question but I'm losing my mind over it.

I tried using a different format string, but that (obviously) didn't work. Using moment.utc() also just had the same result as moment().

Is anyone familiar with the moment library and could help me out here?

Top answer
1 of 9
342

As pointed out in Manto's answer, .utcOffset() is the preferred method as of Moment 2.9.0. This function uses the real offset from UTC, not the reverse offset (e.g., -240 for New York during DST). Offset strings like "+0400" work the same as before:

// always "2013-05-23 00:55"
moment(1369266934311).utcOffset(60).format('YYYY-MM-DD HH:mm')
moment(1369266934311).utcOffset('+0100').format('YYYY-MM-DD HH:mm')

The older .zone() as a setter was deprecated in Moment.js 2.9.0. It accepted a string containing a timezone identifier (e.g., "-0400" or "-04:00" for -4 hours) or a number representing minutes behind UTC (e.g., 240 for New York during DST).

// always "2013-05-23 00:55"
moment(1369266934311).zone(-60).format('YYYY-MM-DD HH:mm')
moment(1369266934311).zone('+0100').format('YYYY-MM-DD HH:mm')

To work with named timezones instead of numeric offsets, include Moment Timezone and use .tz() instead:

// determines the correct offset for America/Phoenix at the given moment
// always "2013-05-22 16:55"
moment(1369266934311).tz('America/Phoenix').format('YYYY-MM-DD HH:mm')
2 of 9
114

A couple of answers already mention that moment-timezone is the way to go with named timezone. I just want to clarify something about this library that was pretty confusing to me. There is a difference between these two statements:

moment.tz(date, format, timezone)

moment(date, format).tz(timezone)

Assuming that a timezone is not specified in the date passed in:

The first code takes in the date and assumes the timezone is the one passed in. The second one will take date, assume the timezone from the browser and then change the time and timezone according to the timezone passed in.

Example:

moment.tz('2018-07-17 19:00:00', 'YYYY-MM-DD HH:mm:ss', 'UTC').format() // "2018-07-17T19:00:00Z"

moment('2018-07-17 19:00:00', 'YYYY-MM-DD HH:mm:ss').tz('UTC').format() // "2018-07-18T00:00:00Z"

My timezone is -5 from utc. So in the first case it does not change and it sets the date and time to have utc timezone.

In the second case, it assumes the date passed in is in -5, then turns it into UTC, and that's why it spits out the date "2018-07-18T00:00:00Z"

NOTE: The format parameter is really important. If omitted moment might fall back to the Date class which can unpredictable behaviors


Assuming the timezone is specified in the date passed in:

In this case they both behave equally


Even though now I understand why it works that way, I thought this was a pretty confusing feature and worth explaining.

🌐
GitHub
github.com › moment › moment › issues › 4799
Is it possible to keep backend timezone? · Issue #4799 · moment/moment
June 15, 2018 - Description of the Issue and Steps to Reproduce: Say I received a date from backend in this format: "2018-10-10T13:00:00+11:00" What I expect to see in frontend after parsing and formatti...
Published   Oct 04, 2018