JavaScript Date Object and Time Zones | Fixing an "off by 1 day" bug

Поділитися
Вставка
  • Опубліковано 17 лис 2024

КОМЕНТАРІ • 97

  • @gkarapeev
    @gkarapeev 3 роки тому +6

    Wonderful tutorial! Straight to the point, no BS, showing what, how, why, and how to find it in the spec! 👏👏👏🏆

  • @Hyp3rX360
    @Hyp3rX360 Рік тому +2

    I've been struggling for 2 days with this issue, thanks for explaining it so clearly!

  • @jonathan.watson
    @jonathan.watson 2 роки тому

    I been learning to code and this had me pulling my hair out for ages, nobody said jack about how your local machines time affects the date input... everyone kept blabbing on about unix being utc which i'd obviously enter and not get the expected result. So many useless stackoverflow posts and finally a video that clearly just explains it.... my fault for not reading the docs in this case tbh. Thanks for the vid.

  • @gravelessForever
    @gravelessForever 3 роки тому

    you're my new favorite youtube coder, please continue making videos

  • @shadowthehedgehog2727
    @shadowthehedgehog2727 2 роки тому

    Thank you so much I was stuck on this at work all day… gonna try this later tonight

  • @MubarikHussain1991
    @MubarikHussain1991 4 роки тому +2

    This is exactly what I was looking for...
    Thank you so much.

  • @xtremewolve
    @xtremewolve 3 роки тому

    awesome, thanks to you I have defeated the demon haunting me for so many years. you have got a new subscriber.

  • @oskarkowalow526
    @oskarkowalow526 2 роки тому +1

    Thank you, your video was really helpful and finally I fixed this bug with offsets in my app.

  • @tjnangosha
    @tjnangosha Рік тому

    You just saved my life. Thanks.

  • @apex30ful
    @apex30ful 4 роки тому

    Thank you :) I am not a developer but this helped me solve a bug for my Team.

  • @RajaRam-qr6we
    @RajaRam-qr6we 2 роки тому

    Thank you very much. It helped me in resolving a real-time scenario

  • @hago7568
    @hago7568 9 місяців тому

    the background music should have been a clown jingle... this is ridiculous. Thanks for explaining it so clearly

  • @thaof1898
    @thaof1898 2 роки тому

    thank you very much sir, i solved my problem with date

  • @telvinnguyennguyen8373
    @telvinnguyennguyen8373 2 роки тому

    Well explained Michael, thank you.

  • @consciousmi4842
    @consciousmi4842 4 роки тому

    Thanks for uploading this video. Very helpful. Keep uploading plz.

  • @sierra7870
    @sierra7870 2 роки тому

    Thank you! Very well explained, this video helped me resolve this same issue in my app!

  • @lovermonkey
    @lovermonkey 15 днів тому

    thank you. Just learning JavaScript. This was one of my issues that I was having issues with. Two questions if you don't mind. If I wanted to format the date to only show month/day/year how would I go about doing that? 2nd question: is there a way to automatically send emails out with outlook without have to click send and without using an outside code to process the event?

  • @BenCooper-en2xe
    @BenCooper-en2xe Рік тому

    have a production error in my app where dates are off by one day. thx for making this!

  • @rajashekhar433
    @rajashekhar433 4 роки тому

    Very useful looking for webpack and node videos

  • @fluffyfriendsonly
    @fluffyfriendsonly 5 років тому +1

    Thank you, this is really helpful.

  • @printprints9071
    @printprints9071 4 роки тому

    This is very useful information. Thanks for that!

  • @noufalbhai2288
    @noufalbhai2288 4 роки тому

    Thank you so much,
    I appreciate your effort to do such a video. It helps me to fix a large bug

  • @giopineda4850
    @giopineda4850 3 роки тому

    Great! Thank you so much. This is very helpful.

  • @djdisconap
    @djdisconap 3 роки тому

    Your a beauty!! Thanks for your help.

  • @MegaAmine26
    @MegaAmine26 2 роки тому

    very helpful, thanks !

  • @VelizFrancia2012
    @VelizFrancia2012 2 роки тому

    very well explained, it will help me a lot, thanks!

  • @modiglianipaganini1126
    @modiglianipaganini1126 4 роки тому

    Great explanation! Thanks a lot

  • @hadi_2122
    @hadi_2122 6 місяців тому

    Thanks your for this video

  • @Cotita
    @Cotita 2 роки тому +1

    This video is interesting

  • @undefined088
    @undefined088 Рік тому

    Thank you! Subscribed :)

  • @milanSK1980
    @milanSK1980 3 роки тому

    Excellent!

    • @makeratplaycoding2666
      @makeratplaycoding2666  3 роки тому

      Thanks!

    • @milanSK1980
      @milanSK1980 3 роки тому

      @@makeratplaycoding2666 Mike, I am just removing moment.js from an angular app and have to come to this video over and over again, coz I have to be carefull about this possible time shift. So I value the video very much!!

    • @makeratplaycoding2666
      @makeratplaycoding2666  3 роки тому

      @@milanSK1980 I appreciate the comment. I have dealt with this bug many times in my programming career.

  • @LegacyInBlood
    @LegacyInBlood 3 роки тому

    Really helpful!!

  • @theworldisyours7437
    @theworldisyours7437 5 років тому

    nice video you look like raymon raddington from blacklist

  • @user-mz9mn1re5q
    @user-mz9mn1re5q 3 роки тому

    Thank you!

  • @DjLeonSKennedy
    @DjLeonSKennedy 3 роки тому

    Thank you so much!

  • @andrescifuentesr.1498
    @andrescifuentesr.1498 2 роки тому

    I tested and It works. However what happens when the string date has not only the date but also hours, minutes and seconds in that case i think it doesn't work. try adding 2019-01-02 13:00 in inputtext Date In in my case result was Wed Jan 02 2019 19:00:00 GMT-0600 (Central Standard Time) (my time zone in browser is Indian/Mauritius)

  • @leifholler506
    @leifholler506 3 роки тому

    Raymond Reddington explaining time zones

  • @abhi7265
    @abhi7265 3 роки тому

    Can i retrieve timezone(or all possible timezone names) based on specific date object which contains offset?

  • @ngneerin
    @ngneerin 2 роки тому

    How to validate on the backend if user is older than 18 years from their date of birth passed as javascript date from frontend client? One user could be from India and one from US with separate time zoned date formats

    • @makeratplaycoding2666
      @makeratplaycoding2666  2 роки тому

      Not sure I understand the question.

    • @ngneerin
      @ngneerin 2 роки тому

      @@makeratplaycoding2666 updated question to better understand

  • @saurabhtiwari0306
    @saurabhtiwari0306 4 роки тому

    Thank You..!!!

  • @ALEXMUSIMBAKYALO
    @ALEXMUSIMBAKYALO Рік тому

    Great

  • @rafaelsobucki2305
    @rafaelsobucki2305 4 роки тому

    Thanks

  • @TorbenRudgaard
    @TorbenRudgaard 7 місяців тому +1

    So january is month "0" in JS - who ever idiot came up with that idea should be sent to North Korea and work as Kims foot stool for the rest of his life!

  • @raba650
    @raba650 3 роки тому

    The code is a little small

  • @talbertherndon1925
    @talbertherndon1925 Рік тому

    bru 16 minutes to explain this is crazy..

  • @shino1780
    @shino1780 Рік тому

    This was a nightmare for me and I fixed it by installing the DayJS library and these methods. I set everyone to ET.
    const dayjs = require('dayjs');
    dayjs.utc('2022-10-29T00:00:00').tz('America/New_York');

    • @makeratplaycoding2666
      @makeratplaycoding2666  8 місяців тому

      It is always good to use a library. Always better to understand how that library is solving the problem.

  • @austinjgregg
    @austinjgregg 3 роки тому

    Thank you!