7
rant1ng
6y

fuck javascript

took me an hour, but I finally figured out why the date was so wack

can you?

admittedly not strong in js, cuz I hate it

Comments
  • 0
    Safari and chrome treat date differently. And that's why front-end developers always have a macbook with Octocat stickers. Now you've learnt this 😉
  • 0
    @sunfishcc why would they have github/octocat on their macbook, because of it?
  • 3
    @JoshBent you will have less haters if there's a cute cat octopus hybrid watch your back🐈🐛
  • 0
    dell windows pc using win bash

    no stickers, not even anti-flag skate stickers
    true rebel

    I can distinctly remember many other sessions like this of complete wasted time because Javascript makes you write 50 lines of code when it should be one. And then the types... the fucking types.
  • 0
    @AlexDeLarge no. I learnt awhile ago that playing with dates is never simple, especially in Javascript. I was patient. However, I never saw a timestamp with miliseconds attached as the last 3 digits like that. I, of course looked up the docs, and read every single date.method() profusively, over and over, scratching my head. I typed out debugging code, patiently, line by line, to see if it was some kind of fluky error. It was super confusing. esp because any other method I'd use would give the correct date. Nowhere in the docs did it mention the miliseconds.
    Javascript is a special language. I hate how it handles types. I never liked it, doesn't make me think I'm better than everyone, I just don't like it. Even people who are familiar with Javascript probably waste time chasing obscure bugs, but that's just a guess. I suppose when you read the history of it(and I have) it's kind of interesting, and it could be something great, but right now, it's frustrating. There, happy?
  • 0
    Sorry, did I read that it's not documented? https://developer.mozilla.org/en-US...

    "Date objects are based on a time value that is the number of milliseconds since 1 January 1970 UTC."

    Literally second sentance of first Google result with search query "javascript date". Just bad googling. Sorry mate.

    And welcome to devRant 😀
  • 0
    @joas Yeah, dude. I know. But when you are used to using timestamps with NO miliseconds, for years, you don't read "miliseconds" you read "seconds". Couldn't they have just put "by the way, the last 3 extra digits are the miliseconds". Even if you see the word "miliseconds" you don't figure it's hidden by 3 digits at the end, unless you have prior experience. Or you have a brilliant moment when you go "oh, right, MILLi
    meaning thousands.. 3 digits, 3 decimal places.. ok". Literally everyone in my shoes will waste at least 15 minutes. Maybe I'm completely ignorant with timestamps b/c I mostly code in php. Whatevs. Now I've ranted about it almost as much as I wasted time with it :p Although ranting is satisfying. Oh, and fuck datetime/timestamps never having ready made functions for your situation, like, literally, every time. Literally. Unless you're using Carbon Date.
Add Comment