Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
That is because what you see on logging a Date object is "prettified" by the console. Because it makes sense there.
To actually work with it use getDay and shit like that on it instead of parsing it.^^ -
52cal4985yFrom the Date.parse() article on MDN: "There are still many differences in how different hosts parse date strings." In the Date MDN article: "Parsing of strings with Date.parse is strongly discouraged due to browser differences and inconsistencies." Date.parse() implicitly calls new Date(), they are equivalent. Also, ReactJS is built on vanilla JS, not sure why you make that distinction in your rant.
-
@52cal ohh yes I forgot that react runs vanilla js, and don't you think it is something quite significant to be made uniform across different browser engines
Related Rants
Javascript is actually a weird language which I dunno why I like a lot.
new Date() in NodeJS gives a different value, while new Date() in the browser console(so react js and normal js) gives a different value.
I dunno if my online searching skills are bad but I didn't find anyone addressing this online. Lol I had to create a manual work around for it then.
rant
js
wtf
weird
reactjs
nodejs