How to clear the timezone associated with a moment-timezone objectHow to convert windows timezone to moment js timezonemoment timezone adjust timestamp to a timezone and return valueTo use timezones with moment do you replace all moment references with moment-timezone instead?timezone and utc using Moment Timezone jsCreate moment.js date from milliseconds in local timezoneGetting a time difference across timezones with moment-timezoneConfiguring WebPack with Moment TimeZone CDNConvert time from other timezone to local timezone using moment/moment-timezoneGet Las Vegas time using moment timezone js

Heyawake - why is this wrong solution

Using processing toolbox conditionally in QGIS?

Why is a pressure canner needed when canning?

Why doesn't Raiden release channel capacity immediately when routing fails?

Is using different public keys for different peers safer than reusing the public key, beyond forward secrecy - x25519

How can I determine which permissions needs to be assigned to the newly created login?

How can I describe hit point damage without talking about wounds?

'This one' as a pronoun

In-universe, why does Doc Brown program the time machine to go to 1955?

Tiny image scraper for xkcd.com

Where on Earth is it easiest to survive in the wilderness?

First Number to Contain Each Letter

What would a biological creature need in order to see into the future?

Was "The Hobbit" ever abridged?

Left my gmail logged in when I was fired

A magician's sleight of hand

What quests do you need to stop at before you make an enemy of a faction for each faction?

Is there any difference between these two sentences? (Adverbs)

Is mathematics truth?

Shoes for commuting

Would you recommend a keyboard for beginners with or without lights in keys for learning?

Has Rey's new lightsaber been seen before in canon or legends?

Who are these people in this satirical cartoon of the Congress of Verona?

Does blackhole merging breaks their event horizon seggregation?



How to clear the timezone associated with a moment-timezone object


How to convert windows timezone to moment js timezonemoment timezone adjust timestamp to a timezone and return valueTo use timezones with moment do you replace all moment references with moment-timezone instead?timezone and utc using Moment Timezone jsCreate moment.js date from milliseconds in local timezoneGetting a time difference across timezones with moment-timezoneConfiguring WebPack with Moment TimeZone CDNConvert time from other timezone to local timezone using moment/moment-timezoneGet Las Vegas time using moment timezone js






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








0















Using moment-timezone, if you have a moment object set with a timezone e.g. moment.tz('America/New_York'), how can you clear the timezone and change the moment to "local" time?



Notably, moment.local() does not work (a subsequent call to moment.tz() still equals America/New_York). I can confirm that my local time is not America/New_York.



The only solution I have found is to set an invalid timezone, e.g. moment.tz('local'). This logs a warning to the console that you have attempted to set an invalid timezone (annoying), but it does clear the timezone associated with the moment object, returning it to a local moment object. The warning that moment-timezone spits out emphasizes that this solution may break in the future though, and it's obviously a hack.



What's the proper way to accomplish this?










share|improve this question






























    0















    Using moment-timezone, if you have a moment object set with a timezone e.g. moment.tz('America/New_York'), how can you clear the timezone and change the moment to "local" time?



    Notably, moment.local() does not work (a subsequent call to moment.tz() still equals America/New_York). I can confirm that my local time is not America/New_York.



    The only solution I have found is to set an invalid timezone, e.g. moment.tz('local'). This logs a warning to the console that you have attempted to set an invalid timezone (annoying), but it does clear the timezone associated with the moment object, returning it to a local moment object. The warning that moment-timezone spits out emphasizes that this solution may break in the future though, and it's obviously a hack.



    What's the proper way to accomplish this?










    share|improve this question


























      0












      0








      0








      Using moment-timezone, if you have a moment object set with a timezone e.g. moment.tz('America/New_York'), how can you clear the timezone and change the moment to "local" time?



      Notably, moment.local() does not work (a subsequent call to moment.tz() still equals America/New_York). I can confirm that my local time is not America/New_York.



      The only solution I have found is to set an invalid timezone, e.g. moment.tz('local'). This logs a warning to the console that you have attempted to set an invalid timezone (annoying), but it does clear the timezone associated with the moment object, returning it to a local moment object. The warning that moment-timezone spits out emphasizes that this solution may break in the future though, and it's obviously a hack.



      What's the proper way to accomplish this?










      share|improve this question














      Using moment-timezone, if you have a moment object set with a timezone e.g. moment.tz('America/New_York'), how can you clear the timezone and change the moment to "local" time?



      Notably, moment.local() does not work (a subsequent call to moment.tz() still equals America/New_York). I can confirm that my local time is not America/New_York.



      The only solution I have found is to set an invalid timezone, e.g. moment.tz('local'). This logs a warning to the console that you have attempted to set an invalid timezone (annoying), but it does clear the timezone associated with the moment object, returning it to a local moment object. The warning that moment-timezone spits out emphasizes that this solution may break in the future though, and it's obviously a hack.



      What's the proper way to accomplish this?







      moment-timezone






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 28 at 3:51









      JohnJohn

      3,6851 gold badge16 silver badges39 bronze badges




      3,6851 gold badge16 silver badges39 bronze badges

























          1 Answer
          1






          active

          oldest

          votes


















          0
















          Update



          This issue was caused by a bug in moment-timezone. As of version, 0.5.24, moment.local() should correctly clear the time zone associated with a moment-timezone object.



          Original



          At the...moment! This appears to be a bug in moment-timezone (see #738, #258). The current work-around I've found is to first use moment.utc() (which clears the timezone and also sets the moment in "utc" mode) and then moment.local(). I.e. moment.utc().local().






          share|improve this answer


























            Your Answer






            StackExchange.ifUsing("editor", function ()
            StackExchange.using("externalEditor", function ()
            StackExchange.using("snippets", function ()
            StackExchange.snippets.init();
            );
            );
            , "code-snippets");

            StackExchange.ready(function()
            var channelOptions =
            tags: "".split(" "),
            id: "1"
            ;
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function()
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled)
            StackExchange.using("snippets", function()
            createEditor();
            );

            else
            createEditor();

            );

            function createEditor()
            StackExchange.prepareEditor(
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: true,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: 10,
            bindNavPrevention: true,
            postfix: "",
            imageUploader:
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            ,
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            );



            );













            draft saved

            draft discarded


















            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55389895%2fhow-to-clear-the-timezone-associated-with-a-moment-timezone-object%23new-answer', 'question_page');

            );

            Post as a guest















            Required, but never shown

























            1 Answer
            1






            active

            oldest

            votes








            1 Answer
            1






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            0
















            Update



            This issue was caused by a bug in moment-timezone. As of version, 0.5.24, moment.local() should correctly clear the time zone associated with a moment-timezone object.



            Original



            At the...moment! This appears to be a bug in moment-timezone (see #738, #258). The current work-around I've found is to first use moment.utc() (which clears the timezone and also sets the moment in "utc" mode) and then moment.local(). I.e. moment.utc().local().






            share|improve this answer































              0
















              Update



              This issue was caused by a bug in moment-timezone. As of version, 0.5.24, moment.local() should correctly clear the time zone associated with a moment-timezone object.



              Original



              At the...moment! This appears to be a bug in moment-timezone (see #738, #258). The current work-around I've found is to first use moment.utc() (which clears the timezone and also sets the moment in "utc" mode) and then moment.local(). I.e. moment.utc().local().






              share|improve this answer





























                0














                0










                0









                Update



                This issue was caused by a bug in moment-timezone. As of version, 0.5.24, moment.local() should correctly clear the time zone associated with a moment-timezone object.



                Original



                At the...moment! This appears to be a bug in moment-timezone (see #738, #258). The current work-around I've found is to first use moment.utc() (which clears the timezone and also sets the moment in "utc" mode) and then moment.local(). I.e. moment.utc().local().






                share|improve this answer















                Update



                This issue was caused by a bug in moment-timezone. As of version, 0.5.24, moment.local() should correctly clear the time zone associated with a moment-timezone object.



                Original



                At the...moment! This appears to be a bug in moment-timezone (see #738, #258). The current work-around I've found is to first use moment.utc() (which clears the timezone and also sets the moment in "utc" mode) and then moment.local(). I.e. moment.utc().local().







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited Apr 30 at 15:01

























                answered Mar 29 at 7:00









                JohnJohn

                3,6851 gold badge16 silver badges39 bronze badges




                3,6851 gold badge16 silver badges39 bronze badges





















                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.







                    Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.



















                    draft saved

                    draft discarded
















































                    Thanks for contributing an answer to Stack Overflow!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid


                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.

                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55389895%2fhow-to-clear-the-timezone-associated-with-a-moment-timezone-object%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

                    용인 삼성생명 블루밍스 목차 통계 역대 감독 선수단 응원단 경기장 같이 보기 외부 링크 둘러보기 메뉴samsungblueminx.comeh선수 명단용인 삼성생명 블루밍스용인 삼성생명 블루밍스ehsamsungblueminx.comeheheheh

                    155 수학 과학 기타 둘러보기 메뉴eh추가해eh문서를 완성해