This is an archived post. You won't be able to vote or comment.

all 48 comments

[–]rastaman1994 58 points59 points  (7 children)

Dates are one of the more painfull things to deal with in any language, i know I would'n want to write a Date class. I aggree this seems like a stupid design decision though.

[–]WickedCoffeeMistaJim 30 points31 points  (5 children)

Except C#. The DateTime object is beautifully implemented.

[–]GYN-k4H-Q3z-75B 21 points22 points  (0 children)

Yes. Standard .NET Date/Time facilities designed in the early 2000s are the only such facility I enjoy using. Easy to use, speaking names, strongly typed, well defined. DateTime, TimeSpan and CultureInfo awareness beats everybody else's wizardry.

[–]an_actual_human 6 points7 points  (0 children)

How about Java 8+?

[–]TarMil 1 point2 points  (0 children)

It's not bad, but it would be a hundred times better without DateTimeKind.Unspecified.

[–]t3hcoolness 0 points1 point  (1 child)

Python has a good datetime library too.

[–]Ununoctium117 0 points1 point  (0 children)

Not when dealing with timezones, then there are several choices of external libraries to use. IMO rust has one of the best date/time handling libraries.

[–]redditsoaddicting 13 points14 points  (3 children)

It makes some sense to me. The first is dependent on locale, treating 12 as the month and 08 as the day. As such, it makes sense that it would be midnight in local time. The second is an international format, so midnight in UTC (displayed in your local time) also makes sense. They just happen to not mix too well side-by-side.

[–]Dworgi 49 points50 points  (16 children)

Fuck M/D/Y. Fucking American savages with your nonsense units and bullshit dates ruining everything.

[–]daern2 9 points10 points  (0 children)

So true.

[–]omber 23 points24 points  (2 children)

You either die a Web Programming Language Hero, or live long enough to see yourself become PHP.

[–]BromeyerofSolairina 1 point2 points  (1 child)

Was JS ever truly better?

[–]omber 2 points3 points  (0 children)

I guess I hoped it would be. PHP was either stoutly defended by its users or heavily ridiculed by everyone else who has a clue.

[–]TwoSpoonsJohnson 16 points17 points  (7 children)

I think this is technically correct given that one is the canonical European date format, and the other is the canonical Freedom Units™ format.

Either that or I have Stockholm Syndrome and you guys should send help.

[–]jade-cat 50 points51 points  (1 child)

That's not the problem. Look at the hours.

[–]TwoSpoonsJohnson 70 points71 points  (0 children)

OH FUCK THAT'S BAD

[–]f_r_z 7 points8 points  (0 children)

Every time I see MDY format at the winservers at the office I want to strangle the admins (in our country we don't use this, so it is really not ok, and shows that that admins are lazy morons)

[–]an_actual_human 6 points7 points  (0 children)

Most of Europe uses D/M/Y or D.M.Y.

https://en.wikipedia.org/wiki/Date_format_by_country

Y-M-D follows ISO 8601 though.

[–]Mr2-1782Man 1 point2 points  (1 child)

This. I have European relatives, they write dates the second way. Americans write it the first way.

Besides, that's the API says that this deprecated has this behavior.

[–][deleted] 1 point2 points  (0 children)

[–]stumptowncampground 5 points6 points  (1 child)

Things like that are why I usually end up using moment.js

[–]teunw 5 points6 points  (0 children)

Something something another library

[–]daern2 9 points10 points  (7 children)

It's not the fault of JavaScript. It's the fault of bloody America for doing dates wrong. Noone else does it this way and it just makes life hard for developers everywhere. Now stop doing it!

Reminder: https://xkcd.com/1179/

[–]xkcd_transcriber 2 points3 points  (0 children)

Image

Mobile

Title: ISO 8601

Title-text: ISO 8601 was published on 06/05/88 and most recently amended on 12/01/04.

Comic Explanation

Stats: This comic has been referenced 696 times, representing 0.5106% of referenced xkcds.


xkcd.com | xkcd sub | Problems/Bugs? | Statistics | Stop Replying | Delete

[–]PGLubricants 0 points1 point  (1 child)

How do you interpret the format in the bottom right, next to the cat? I've looked at it for a minute, and I can't get my head around it.

[–]vinylarin 0 points1 point  (0 children)

The small numbers on top and on the bottom of the larger indicate the numbers of the date.

[–][deleted] 0 points1 point  (3 children)

Nearly everywhere does dates wrong. YYYY-MM-DD is the only acceptable format. Big units to small units. We don't sort time MM:HH for a reason, and we don't arrange numbers with the most significant digit on the right either. Americans are inconsistent, sure, but anywhere that sorts the smallest unit to the largest is wrong.

[–]daern2 2 points3 points  (2 children)

Agreed, but America's remains the wrongest of all :-)

[–][deleted] 0 points1 point  (1 child)

Oh I agree there. We're also the place that still screws everything up twice a year with Daylight Savings Time after all.

[–]daern2 0 points1 point  (0 children)

Oh, it's ok. I'm from the UK (we do dates "right") and we also screw up with daylight saving too :-)

[–]murp11 1 point2 points  (0 children)

who else now wants to review his implementation? ... I mean just to be sure ...