Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Manish Chandra
    My web pack config
    Client ---
    ```module: {
    rules: [
    test: /.[t,j]sx?$/,
    exclude: [
    use: [
    loader: 'babel-loader',
    options: {
    presets: ['es2015', 'stage-1'],
    plugins: ['transform-decorators-legacy']
    loader: 'ts-loader',
    options: {
    configFileName: './src/common/ts/amd.es5.tsconfig.json',
    test: /.s?css$/,
    use: ['style-loader', 'css-loader', 'sass-loader'],
                    test: /\.js$/,
                    use: ['react-hot', 'babel-loader'],
                    include: path.join(__dirname, 'vendor')
                    test: /\.(png|jpg|gif|ico)(\?v=\d+\.\d+\.\d+)?$/,
                    use: 'url-loader?limit=100000'
                    test: /\.(eot|com|json|ttf|woff|woff2)(\?v=\d+\.\d+\.\d+)?$/,
                    use: 'url-loader?limit=10000&mimetype=application/octet-stream'
                    test: /\.svg(\?v=\d+\.\d+\.\d+)?$/,
                    use: 'url-loader?limit=10000&mimetype=image/svg+xml'
                test: /\.json$/,
                loader: 'json-loader',
        ], ```
    Serrver config ---
    module: { rules: [ { test: /\.ts$/, use: [{ loader: 'ts-loader', options: { configFileName: './src/common/ts/cjs.es5.tsconfig.json', }, }], }, { test: /\.json$/, loader: 'json-loader' } ], },
    Any suggestion ?
    Hey people, I have a problem. I think because of the daylight saving changes this weekend moment timezone is not confused and say Moment Timezone has no data for CEST. I try to add it with moment.tz.add(...) and moment.tz.load([...]) but I'm not sure where to add it exactly. I have the latest package of moment and moment timezone and running angular 5. Any suggestions?
    Jeff Voss
    Does anyone know how to use moment to format a date to match this date in JAVA "yyyy-MM-dd'T'HH:mm:ss'Z'"
    Mohit Anand
    Hey, is there a place new comers can discuss ?
    Jon Concepcion

    In my karma test, I am having an issue. any help with this..

    TypeError: Cannot read property 'format' of undefined

    Shane Bruggeman
    Hey folks, trying to use moment-timezone in ember-moment and it's attaching to window.moment instead of the moment loaded through my package.json
    I see it using the window.moment as the moment argument here:
    The else clause there
    (function (root, factory) {
        "use strict";
        /*global define*/
        if (typeof module === 'object' && module.exports) {
            module.exports = factory(require('moment')); // Node
        } else if (typeof define === 'function' && define.amd) {
            define(['moment'], factory);                 // AMD
        } else {
            factory(root.moment);                        // Browser
    }(this, function (moment) {
    If something in ember-moment is importing / requiring in that as a module, how would they specify the arguments?
    Shane Bruggeman
    Don't know a ton about package defining, so I'm at a loss as to how root comes into here. Ideally it would be the moment dependency brought in from ember-moment's npm install
    hello everyone.
    i have a date with timezone, that gets parsed on chrome but firefox fails
    how to fix that ?
    Abayomi Omosehin
    Hello,Pls how can I use moment js in my react app as start date and end date
    how can i achieve the enddate is always greater than the start date
    why would I be getting the deprecation message with the following line of code. I thought the String + format was suppose to remedy the issue. moment.tz('2015:08:20 14:33:20', 'YYYY:MM:DD HH:mm:ss', 'America/New_York') . Also, please not I do not have control over the date format being provide. I know I can convert it myself to 'YYYY-MM-DDTHH:mm:ss' in moment does not show the deprecation message. However, according to the documentation, the line of code should work. Here is the deprecation message I am seeing. "Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged and will be removed in an upcoming major release. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info."
    Raymond Bergen

    Hi all does any one know how to use moment and moment-timezone?
    if i do

    import * as moment from 'moment'
    import { utc } from 'moment-timezone'

    i get utc, is not exported by node_modules/moment-js

    i use rollup
    I am getting below error when installing moment timezone using bower a The "main" field cannot contain minified files
    bower resolved https://github.com/moment/moment-timezone.git#0.5.25
    anyone know how to fix?
    Jack Howard
    seeing behavior I don't terribly understand. loading only a few timezones via moment.tz.load(MOMENT_TZ_DATA);. But seeing a whole host of seemingly unincluded timezones available -- and working -- when I use moment.tz with a timezone. I've also tried looking at moment.tz.names() to see available timezones
    found that tz data may be separate from loading the data manually moment/moment-timezone#369
    Jack Howard
    It seems like this a hack to get around excluding locales, then manually adding them. does anyone else have any suggestions? moment/moment#2416
    Hi all,
    i am using moment('2019-05-21T07:05:11.5685421-07:00').format('MM/DD/YYYY HH:MM:SS') function which is giving wrong time as '05/21/2019 08:05:11' even after changing time zone to (UTC-07:00)Mountain Time(US & Canada) . It should be 07:05:11. Please help me out to get the right time.
    Hey guys... running grunt data with the latest release no longer succeeds. This is because the latest data dump results in a packed\latest.json containing a zone of "Etc/UTC||||" instead of what used to be "Etc/UTC|UTC|0|0|", ... I'm getting a little lost in the code for where the zones are loaded and figured asking the more hands-on devs here would lead to a quicker resolution of the issue so I can complete a PR I'm working on. I guess my question is - could this be due to IANA breaking how the data is formatted, or is this a change that the devs are already aware of and working on fixing?
    whats interesting is that the latest.json committed to code is 2019b - the same as what is being requested as latest, now, but the latest.json that is generated when I run grunt data is fairly significantly different
    I can verify that grunt data:2014d with both the code in the release branch as well as the changes I made to it, so it is definitely a data issue - but again, is this a known issue that the devs are working on or is this an oopsie from IANA
    confirmed adding the following to the very top of function unpack in moment-timezone.js "fixes" the issue
            if (string === 'Etc/UTC||||') {
                string = 'Etc/UTC|UTC|0|0|';
    spoke too soon, npm run test failed 25 assertions
    and we're fixed
    Jonathan Chrisp
    Hi all, is there anyway to define which version of moment you want to use when using moment-timezone? When I import moment-timezone it uses moment version 2.22.2 under the hood. I need to use the latest version (2.24.0) as I'm adding and subtracting an isoWeek which has only been fixed recently.
    Jonathan Chrisp
    I've raised a PR to update the version here: https://github.com/moment/moment-timezone/pull/777/files
    Jonathan Chrisp
    Hey all, does anyone have any feedback on the above? 🙏
    Kan Yilmaz
    Is this channel active still?
    I'm curious about a way in express to do (100s) of time operations for each request where the calculations should be based on the users' timezone. Basically rather than having moment(myDate).tz(timezone) for 100s of places, is there a way to make the setDefault() function work per request rather than per application?
    Domenic Horner
    const moment = require('moment-timezone'); const dateStart = moment().tz("2020-06-01", "Australia/Perth").startOf('day').utc().format("YYYY-MM-DD"); -> getting Moment Timezone has no data for 2019-01-01., i have included moment-timezone, not sure why data is not included?
    Domenic Horner
    @tgxn It was because it needs to be moment.tz() and not moment().tz()
    Jonas Amundsen
    I think I have encountered an issue where the presence of some formatting tokens affect the output of others, as seen here:
    $ node
    > require("moment-timezone").tz("1 Jan 1970", "D MMM YYYY", true, "Mexico/BajaSur").format("gggg")
    > require("moment-timezone").tz("1 Jan 1970", "D MMM YYYY", true, "Mexico/BajaSur").format("NN gggg")
    'AD 1970'
    > require("moment-timezone").tz("1 Jan 1970", "D MMM YYYY", true, "Mexico/BajaSur").format("N NN gggg")
    'AD AD 1971'
    Is this intended behavior?
    Jonas Amundsen
    This further seems to illustrate a problem with internal state, which was introduced in 2.25.0
    const moment = require("moment-timezone").tz("1 Jan 1970", "D MMM YYYY", true, "Mexico/BajaSur");
    console.log(moment.format("gggg")); // => "1970"
    moment.format("N NN");
    console.log(moment.format("gggg")); // => "1971"
    1 reply
    Jonas Amundsen
    Also, what is going on here?
    $ node
    > require("moment-timezone").tz("21 Aug 1993 23:00", "D MMM YYYY HH:mm", true, "Kwajalein").format()
    > require("moment-timezone").tz("21 Aug 1993 00:00", "D MMM YYYY HH:mm", true, "Kwajalein").format()
    > require("moment-timezone").tz("21 Aug 1993 23:00", "D MMM YYYY HH:mm", true, "UTC").format()
    > require("moment-timezone").tz("21 Aug 1993 00:00", "D MMM YYYY HH:mm", true, "UTC").format()
    Jonas Amundsen
    Ah, it appears the offset actually changed quite a lot around that time

    Hello guys i have a problem with moment.tz(), moment.tz() doens't keep track of daylight savings?

    I have User Timezone that i save in database
    And i can set on a call a certain timezone

    What i have to do is to convert the call time with that certain timezone to the user's timezone, so for example the Call is 8 PM in Eastern Time and User's timezone is Alaska(America/Nome). The reason i'm doing this is to show the user the actual time in his timezone when that call with different timezone will start.

    If i convert the call time with Alaska timezone(moment.tz(callTime, userTimezone)) it will be 5 PM, and it shoud've been 4 PM because Alaska today has daylight savings it's -8.

    Is something i can do from moment js?

    I mean i have on API the daylightsavings and i can substract('hour', daylightSavingsNumber); and it will show correctly but from front end point of view can i do something?

    Artsiom Miklushou

    Hi there!
    Maybe someone will cast light to me, I have these two dates

    moment.tz("2012-01-30 07:25:53", "Australia/Sydney").diff(moment.tz("2013-02-28 07:25:53", "Australia/Sydney"), 'months');

    And diff gives me 13 months, but it is actually 12 months, 29 days excluding the end date. according to

    Rishikesh devkate
    I got the list of timezones by moment.tz.names() like e.g 'America/New_York', 'America/New_York', 'America/Los_Angeles', 'America/Los_Angeles' But i want to convert this list to Eastern Standard Time,Eastern Daylight Time,Pacific Standard Time
    So how can i do that please help.
    Hello Everyone,
    I have a functionality in APP where once user changes the TimeZone I want to set the default timezone everywhere in APP. setting the default timezone must change the current time obviously by offset.
    I am doing it in following way moment.tz.setDefault('Asia/Tbilisi'); the strange thing is that as my current timezone is GMT+4 (Asia/Tbilisi) when I set it by this function it offsets the current time by +4 hours; so if my current time is 13:00 (local time) then after calling this function I get 17:00 of current time. Could you please tell me what I am doing wrong? Thanks