Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Raj
    @rajjaiswalsaumya
    i have a date with timezone, that gets parsed on chrome but firefox fails
    how to fix that ?
    Abayomi Omosehin
    @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
    douglassllc
    @douglassllc
    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
    @FreeFrags

    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
    monterey01
    @monterey01
    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
    @JackHowa
    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
    @JackHowa
    It seems like this a hack to get around excluding locales, then manually adding them. does anyone else have any suggestions? moment/moment#2416
    Shreedevi-G-Rao
    @Shreedevi-G-Rao
    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.
    epimeth
    @epimeth
    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
    epimeth
    @epimeth
    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
    epimeth
    @epimeth
    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
    epimeth
    @epimeth
    and we're fixed
    Jonathan Chrisp
    @jonathanchrisp
    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
    @jonathanchrisp
    I've raised a PR to update the version here: https://github.com/moment/moment-timezone/pull/777/files
    Jonathan Chrisp
    @jonathanchrisp
    Hey all, does anyone have any feedback on the above? 🙏
    Kan Yilmaz
    @thellimist
    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
    @tgxn
    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
    @tgxn It was because it needs to be moment.tz() and not moment().tz()
    Jonas Amundsen
    @badeball
    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")
    '1970'
    > 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
    @badeball
    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
    @badeball
    Also, what is going on here?
    $ node
    > require("moment-timezone").tz("21 Aug 1993 23:00", "D MMM YYYY HH:mm", true, "Kwajalein").format()
    '1993-08-20T23:00:00-12:00'
    > require("moment-timezone").tz("21 Aug 1993 00:00", "D MMM YYYY HH:mm", true, "Kwajalein").format()
    '1993-08-22T00:00:00+12:00'
    > require("moment-timezone").tz("21 Aug 1993 23:00", "D MMM YYYY HH:mm", true, "UTC").format()
    '1993-08-21T23:00:00Z'
    > require("moment-timezone").tz("21 Aug 1993 00:00", "D MMM YYYY HH:mm", true, "UTC").format()
    '1993-08-21T00:00:00Z'
    Jonas Amundsen
    @badeball
    Ah, it appears the offset actually changed quite a lot around that time
    TrofinSorin
    @TrofinSorin

    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
    @mikla

    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');
    -13

    And diff gives me 13 months, but it is actually 12 months, 29 days excluding the end date. according to
    https://www.timeanddate.com/date/timezoneduration.html?d1=30&m1=1&y1=2012&d2=28&m2=2&y2=2013&h1=7&i1=25&s1=53&h2=7&i2=25&s2=53

    Rishikesh devkate
    @rishidevkate_twitter
    Hi
    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.
    shalvagelenidze
    @shalvagelenidze
    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