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
-
@SuspiciousBug If it's Unix time, how do you get the second? If it's a struct of ints, how do you get the first?
-
I will be writing a compiler for structured text soon. Looks like I'm in for a world of fun 👁👄👁
-
Voxera113882yJust don’t :)
If its even possible in what ever language you are using it will depend on how the datetime is stored under the hood, and we should generally not build code that depends on that since such code will be harder to maintain and are more likely to break upon new versions of the compiler.
C famously have such undefined cases where different compilers get different results due to different assumptions and since the language does not enforce one specific way, both are right or wrong depending on your point of view.
Js also has a lot of strange casts that I also try to avoid since the day you need to refactor it you will need to find every such “clever” cast and change it ;) -
danzulos1202yDeep down, all data is binary, so you can cast anything to anything (if your language allows it).
Yall ever cast a bool to a dateTime?
Fucking structured text never ceases to amaze me!
rant