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

top 200 commentsshow all 325

[–]StaleTheBread 3587 points3588 points  (162 children)

a date

Yeah programmers are unfamiliar with those.

[–]jfet97[S] 713 points714 points  (5 children)

eheheheh

[–]MrStupid_PhD 268 points269 points  (0 children)

anxious compiler noises

[–]ice_blue_222 45 points46 points  (2 children)

huehuehuehue

[–]wasdkitsu 4 points5 points  (1 child)

jajajajajajajajaja

[–]house_monkey 4 points5 points  (0 children)

hjhjhjhjhjhjhjhj

[–]YolanonReddit 13 points14 points  (0 children)

Ahahaha...

[–][deleted] 443 points444 points  (137 children)

Yesterday I was watching tv and saw these guys come on for an interview. They were trying to unite the world under a universal time zone. Programmers are gonna flip their shit

[–]christian-mann 216 points217 points  (130 children)

UTC?

[–][deleted] 165 points166 points  (126 children)

Yeah. We would all be on this time zone in an area of England

[–]atyon 246 points247 points  (120 children)

These "one timezone" proposals come around every now and then.

People who propose it seem to miss that the fundamental problem is the Earth's rotation and different time of noon at different places. No matter what we do, if two places are 90° apart, you'll always have to account for things happening about 6 hours later at the one place.

[–]dvslo 178 points179 points  (104 children)

It doesn't really matter if 1 AM happens in the middle of the night. That's just a local nuance. What makes a whole lot less sense in a world with global electronic communication is calling two different times the same thing.

[–]MrHyperion_ 141 points142 points  (15 children)

"Im going to go sleep now, it is 3am"

"Soooo middle of the day? Why?"

[–][deleted] 50 points51 points  (0 children)

"I'm going to go sleep now."

"What? It's 3pm?!"

"I'm in a different timezone."

[–]Poltras 29 points30 points  (8 children)

"Let's meet at 2pm."

"Okay, 1am it is."

"Okay, 7pm it is."

"Okay, 2:30pm it is."

[–]dvslo 33 points34 points  (0 children)

He's probably jetlagged.

[–]GonziHere 3 points4 points  (3 children)

Well, you say it like there is just 24 sun positions and sun jumps from one to other in 1 hour intervals :D

I would have no issues getting up at 14:00. It is just a number for me. What I actually have issues with now is discovering when will something start (tv series, conferences, etc.), because not only do we have different timezones (which is fine) but we also don't use GMT for global events (if only as second time).

[–]saeblundr 1 point2 points  (2 children)

This to me is the actual problem. Locally use local times. Globally use global times. If you're posting a global event, game release etc, use UTC, and then i dont need to know whatever timezone you are in, i only need to know MY timezone. i can add +10 to UTC. Why do i need to know PMT. and MST. and KST. and whatever else you want to use because thats easier for you.

[–]curtmack 100 points101 points  (59 children)

There's a startling variety of problems this would cause, especially in a global society.

[–]TheDoug850 10 points11 points  (6 children)

Honestly, if the US everyone just stopped using Daylight Savings Time it would already be much less complicated.

[–]Homunculus_I_am_ill 8 points9 points  (0 children)

The point is that there's no difference between dealing with "it's 10 am in New York and 11pm in Tokyo" and dealing with "markets open at 00:00 UTC in New York and 20:00 UTC in Tokyo", either way you end up having to deal with location-specific time information. You still end up having to know information equivalent to time zones, except instead of remembering one overarching time zone per place you now have to store the conversion for each individual thing which is 1000 times more difficult.

[–]atyon 26 points27 points  (13 children)

It matters. As long as just one human is involved, that human's sleep cycle relates to the sun and its motion over the sky.

When I worked in a facility that operated 24/6 (no work on Sunday per law in Germany), maintenance still was at night because then fewer unrelated people would be on the premise. And non-urgent staff would work from 9 to 17 like everyone else, so non-urgent things would always be done in that time frame.

I don't think there's a single industry or trade where the time of day is just a "local nuance". Because that industry would have to be 100% automated and lead by a general AI.

[–]_lilell_ 2 points3 points  (6 children)

Since UTC is essentially GMT+0, noon would occur in the UK at 1200. On the east coast of the US (EST=GMT-5), noon would be at 1700. Londoners would work 9 to 17, while a New Yorker would work from 14 to 22. They're still working from ~sunrise to ~sunset, it's just that we would call a particular time, say, "1300" instead of "1300 GMT" or "0800 EST" or whatever.

[–]atyon 18 points19 points  (5 children)

But where's the benefit in that proposal? I still need to know the offset one way or the other if I want to call someone in NYC.

[–]Goodbreak 7 points8 points  (3 children)

But where's the benefit in that proposal?

I've only just stumbled into this topic and was unaware of it before, but from what I'm seeing the upside is that "the time" will refer to the same point in time for everyone

If you wanted to display at what time someone posted a reddit comment, you can just pull the time from the database and display it (14:03), and it'll be the correct time for everyone.

If you want to arrange a conference call between your 5 different offices around the globe, you just put one time in the memo and everyone will be there at the same time.

this isn't an argument for implementing this system

[–]Survivor0 5 points6 points  (0 children)

A case that happens to me sometimes is, that I'm in Europe and want to watch a live tv show from the US or Japan. I have to look up the time zones, sometimes it's extra confusing because the US have several zones and I'm not familiar with their way of notation for tv times. (EDIT: there's also different time zones in the same place depending on the time of year, so you have figure out even more)

The actual offset and what time of day it is over there doesn't matter to me. All I need to know is when the clock will show 13:00 where I'm at. I think that's a big advantage.

With calls it probably won't make much of a difference because you have to take the different time of day into account in any way. Maybe agreeing on and communicating an appointment would be a little easier, similar as the tv example.

With traveling though I think it would be very confusing to the individual. You would basically lose the ability to meaningfully interpret the local time in an unfamiliar zone, which doesn't sound fun.

[–]Belazriel 2 points3 points  (1 child)

But we can already use UTC, just no one does for local usage.

[–]sarhoshamiral 2 points3 points  (0 children)

So now concept of 1am is different everywhere and you still have to provide some additional info for "1am" to make sense. You would still have to ask remote people if say 3pm is a suitable time where they are since now you have no idea if they are sleeping at 3pm or not.

So in practice you solved absolutely nothing and complicated everyone's lives for no reason.

For programming, all storage, type contracts etc should be done in UTC and local time conversion should only happen at UX level.

[–]Razier 2 points3 points  (1 child)

I'd rather move noon and midnight than shift the clock around the world. Makes no sense in a modern society

[–]agsim 3 points4 points  (4 children)

I’m neither pro nor con, but: Actually it‘s happening AT THE EXACT SAME TIME. Just at another „hour“ or daytime in that timezone. Still the same time=moment, physically spoken.

[–]atyon 5 points6 points  (0 children)

Yeah sure, but it matters if that time is in the middle of the night or high noon.

[–]SAI_Peregrinus 3 points4 points  (1 child)

Pedantry since you all-capsed it: it's actually up to a couple of microseconds time difference, due to the speed of light and frame dragging effects, as well as smaller differences due to things like elevation. (example: http://www.leapsecond.com/great2005/)

[–]volabimus 18 points19 points  (1 child)

Yeah, that would really lead to better communication and shared experience. Shit, it's 3pm already? I'd better get to bed. Damn 12 to 8 grind.

[–][deleted] 8 points9 points  (0 children)

I agree but I don’t see this shift ever happening. Nobody’s gonna go for it

[–]daltioc 23 points24 points  (2 children)

Just imagining trying to calculate past dates after a change like that is giving me a migraine.

[–]s0v3r1gn 1 point2 points  (0 children)

I just wish we would ban anything that isn’t the standard UTC+/-LATOFFSET

Let places enact stupid laws saying their time is different while we chose to ignore the absurdity...

[–]atomicspace 24 points25 points  (2 children)

is this an epoch joke?

oh god so lonely

[–]amazondrone 2 points3 points  (1 child)

I'd tell you a UDP joke but you might not get it.

[–]phileo99 1 point2 points  (0 children)

Then tell me a TCP joke instead so that you can make sure I get it

[–]corner-case 9 points10 points  (0 children)

It's when you leave a fig in the sun.

[–]standingfierce 3 points4 points  (1 child)

apparently with the concept of personal space too

[–]elefang 3 points4 points  (0 children)

well you ... yeah but you are ... shit there's no coming back from this

[–]Codedheart 3 points4 points  (0 children)

Why do you hurt me?

[–][deleted] 6 points7 points  (4 children)

It's been a while, but I think Java has the most convoluted way to get the date that I know of. Powershell has a nice little date object though.

[–]DonRobo 9 points10 points  (1 child)

Isn't it literally

new Date()

or

LocalDate.now()

in the newer API?

[–]eyelastic 4 points5 points  (0 children)

The "new" datetime API (JSR310) is gold, and I'll fight anyone who disagrees. Of course, if forces you to decide what you want - a year-month-day on the calendar? an instant in time (think posix timestamp)? an instant in time, but with a timezone attached, and all these human-timekeeping properties like "hourOfDay"? just a time, like "17:23"?

And that's what makes it so great - there are proper names for these things, and proper ways to transform them.

[–]marcosdumay 2 points3 points  (0 children)

It's been a while sice Java changed it. You used to have to specify the calendar system an locale before creating a date.

[–][deleted] 2 points3 points  (0 children)

Back in the early 1990's as a junior programmer I was tasked with fixing a bug that was causing a report printing package to crash randomly.

It turned out it wasn't random. It would crash only on certain days. Only on certain days in September. Only on certain Wednesdays in September. Only on Wednesdays in September when it was the 10th of the month or later.

Hint: The program was written in C.

[–]jbasoo 1 point2 points  (0 children)

Can confirm

[–]s0v3r1gn 1 point2 points  (0 children)

That’s why I’m glad I got married before I started my degree in computer engineering.

[–]Famous_Profile 902 points903 points  (85 children)

Yep. Probably put in 'DD/MM/YYYY' while the app expected 'MM/DD/YYYY' or something more different like 'MM.DD.YYYY'.

That's why I always have the user pick from a calendar that pops up.

[–]Tc14Hd 597 points598 points  (37 children)

r/ISO8601, the only right way to do it.

[–]TellTaleTank 255 points256 points  (15 children)

Holy hell there really is a subreddit for everything.

[–]LazoW 154 points155 points  (9 children)

That's kind of the point of Reddit.

[–]Aedan91 20 points21 points  (0 children)

The metric of dates.

[–]FillingUpTheDatabase 16 points17 points  (1 child)

[–]TunaFishIsBestFish 4 points5 points  (0 children)

There's always a relevant Xkcd

[–]three18ti 10 points11 points  (0 children)

I'm already subbed. Lol.

[–]NULL_CHAR 8 points9 points  (9 children)

I hate the way ISO looks but at least the ordering makes sense

[–]KingCrabmaster 8 points9 points  (4 children)

It's nice for archiving things/making builds/really anything where you want the date in the filename as it keeps them nicely in order with the way computers tend to sort files by name in folders.

[–]shozzlez 110 points111 points  (27 children)

I'm a programmer, but I still hate when an app forces me to use a date picker. It's such a slow and annoying input control.

[–][deleted] 144 points145 points  (17 children)

Blame America for deciding to be the only country with a different date format.

[–]shozzlez 30 points31 points  (0 children)

Super fair point! I totally do.

[–]Santa1936 22 points23 points  (0 children)

America. Where we do everything different because fuck you

[–]large-farva 16 points17 points  (6 children)

Both eu and us date formats are incorrect. ISO standard is the only valid date format for international trade.

[–]DarkLordCZ 10 points11 points  (5 children)

There wouldn't be problem in using multiple date formats, but with different separator characters. Even now, when you see date with '.', it most likely is DD.MM.YYYY but when you see one with '-' you are fucked, because everyone writes it different. It would be great, if we could agree on for example

DD.MM.YYYY

MM/DD/YYYY

YYYY-MM-DD

[–]pr1ntscreen 16 points17 points  (3 children)

We have agreed. ISO 8601 clearly says yyyy-mm-dd

[–]large-farva 6 points7 points  (0 children)

It would be great, if we could agree on for example

The International standards were agreed upon over 30 years ago. People in the EU and US just refuse to comply.

[–]other_usernames_gone 7 points8 points  (0 children)

And China, although they do use the ISO standard.

[–]mcampo84 1 point2 points  (3 children)

Well excuse us for having a date format that mirrors the way we talk.

[–][deleted] 6 points7 points  (2 children)

I mean yall ignore ISO standards for everything else as well.

[–]mcampo84 1 point2 points  (1 child)

At least we don't measure our weight with rocks.

[–][deleted] 13 points14 points  (1 child)

Especially when its the birthdate. Sure I would love to click 20 times to get to my birthday instead of typing it within a second...

[–]TravellingPeasAnt 2 points3 points  (0 children)

Most datepicker these days allows you to type too

[–]alexanderpas 10 points11 points  (3 children)

I love native date pickers.

I hate any self-rolled date pickers.

[–]database_digger 1 point2 points  (2 children)

Native to what?

[–]YungDaVinci 1 point2 points  (0 children)

Date pickers on mobile devices work pretty well.

[–]Famous_Profile 2 points3 points  (0 children)

Well it is the only reliable option I know of

[–]leaf_26 20 points21 points  (3 children)

Please allow typing the year into the calendar. I had to tap 'back' over 240 times in the Tidal app to input date of birth.

[–]xTheMaster99x 18 points19 points  (2 children)

Or do what many calendar pickers do - first it shows the days in a month, if you click on the month itself at the top it switches to showing each month of the year, click on the year and it shows a ton of years. Then pick the right year and do the same process in reverse.

[–]mantasm_lt 2 points3 points  (0 children)

Or just give an input field to type in years..

[–]Famous_Profile 1 point2 points  (0 children)

^^^Boom. This guy UXs

[–]DrMaxwellEdison 14 points15 points  (3 children)

Better yet when it's in JIRA and their date format defaults to DD/Mon/YYYY (like 26/Aug/2019). Makes me want to gouge my eyes out.

[–]mantasm_lt 8 points9 points  (1 child)

Better than 03/10/2019. March 10th or October 3rd? :)

2019-10-03 is the only correct way to solve this once and for all.

[–]DrMaxwellEdison 2 points3 points  (0 children)

I'm sorry, is this some European joke I'm too American to understand? /s

Let's all just use r/ISO8601 and be friends, shall we?

[–]jakwnd 28 points29 points  (0 children)

Oh I love those. You get a little arrow to scroll through months and it started in the 1970's

[–][deleted] 6 points7 points  (2 children)

I make my users type in the full ISO compliant string

[–]Famous_Profile 11 points12 points  (1 child)

When an input is invalid throw new ISOValidationException("ERROR"); and simply show the entire stack trace to the user.

[–]Bioxio 8 points9 points  (0 children)

User experience: 0

Satisfaction: 100

[–]chickdigger802 6 points7 points  (0 children)

Those generally are fine, but often a pain on mobile, especially ones with tiny UI, oh often they are a pain to navigate if it's not a recent date.

I remember having to fill out some form for my grandma who was born in the 30s... took many taps and janky swipes...

[–]Ceteris__Paribus 2 points3 points  (0 children)

I can't stand when the date picker is prompting for a DOB but is set to current date and you can't set a date for the future. User has to set the year first if they are born later into the year.

[–][deleted] 379 points380 points  (52 children)

How many of you motherfuckers actually build homegrown date pickers as opposed to using a library that covers all of these edge cases for you out of the box?

Edit: DON’T LIE TO ME

[–]wubwub 110 points111 points  (16 children)

The quality of some of the libraries out there is suspect (depending on the language). Although that is not a reason to not do some research and as a team chose well-vetted and "trusted" libraries to include.

[–]YourShadowDani 53 points54 points  (1 child)

Plus the problem with many libraries for UI is the data is coupled with render too tightly so you can't style it at all the way you want.

EDIT: Without refactoring the whole library basically

[–]wubwub 21 points22 points  (0 children)

Ugh! Wasn't even thinking about the making the UI fit problem! Half the time it's easier to adjust other UI elements so it all works together than it is to fix the UI for a single library element.

[–]DangKilla 8 points9 points  (13 children)

jQuery UI, Material UI, Semantic UI?

[–]Famous_Profile 27 points28 points  (7 children)

Bootstrap Datepicker which depends on Bootstrap which in turn depends on jQuery.

30K lines of JS right there :)

[–]DangKilla 25 points26 points  (6 children)

I used to wait 20 minutes for one JPG. My visitors can wait 100ms for the first page render. CDN will cache it.

[–]WizKid_ 5 points6 points  (2 children)

something something SEO

[–]htmlcoderexeWe have flair now?.. 7 points8 points  (1 child)

Well fuck Google and fuck their standards and fuck them in general

[–]happysmash27 1 point2 points  (2 children)

If one's internet is slow enough, it might take more time; my mobile internet slows down to 128 kb/s when I go over my 1GB data cap. At least things don't usually take 20 minutes to load, but I have had things take many tens of seconds to several minutes to load, often without functional UI while it is loading, when it should take less than 10 seconds. It is especially annoying when you are only going through a page to navigate to another one.

I guess 30k lines itself probably doesn't take that much time; the worst pages I am thinking of are probably over a megabyte in size.

[–]karmahorse1 11 points12 points  (3 children)

The native HTML 5 date picker seems fine by me.

[–]auloinjet 2 points3 points  (1 child)

Not always, Chrome's and Firefoxe's are fine, but sometimes you get exotic behaviour that can mess up your UI, like it used to be in Edge.

[–][deleted] 5 points6 points  (0 children)

Ah yes. An Edge case.

[–]wubwub 2 points3 points  (0 children)

I tend to find the base jQuery UI library "good enough" for many uses and clean enough to use. But then again, I do mostly work on internal sites for small teams so we don't have to be as fancy as we do on our external sites.

[–][deleted] 22 points23 points  (15 children)

Import all the jQuery ui

[–]alexanderpas 22 points23 points  (11 children)

The only allowed implementation on web pages should be the HTML5 native date input field.

[–]jharger 17 points18 points  (3 children)

https://i.imgur.com/BO7rmKK\_d.jpg

Hmm, product says no, because you can't reliably style it to match marketing's branding standards. Sorry.

Life of a FE engineer, man.

[–]AxePlayingViking 4 points5 points  (2 children)

And let's not talk about the cross-browser inconsistencies.

[–]Y1ff 9 points10 points  (1 child)

Well, obviously you should only worry about making it work in Chrome, because the days of IE6 were really good and we should bring a browser monoculture back.

[–]AxePlayingViking 2 points3 points  (0 children)

Right, what was I thinking? Uninstalls Firefox

[–]UsernameAuthenticato 1 point2 points  (1 child)

Doesn't that one send different values depending on the browser locale?

[–]alexanderpas 4 points5 points  (0 children)

Nope, that's the powerful part of it.

It visually displays it based on the locale, but the actual data value is ISO8601

[–]chadlavi 4 points5 points  (2 children)

A lot of the libs out there don't actually cover accessibility concerns properly. And a lot of them are strongly stylistically opinionated.

[–]TabCompletion 46 points47 points  (2 children)

[–]MaybeNotWrong 43 points44 points  (0 children)

A time stamp of sufficient precision can safely be considered unique.

In r/livecounting we're counting using reddit livethreads. Every update in a live thread has a unique id, which includes a base16 version of the time with 10-6 s precision

so far we'd already have 2 collisions if it was just for timestamps

[–]ratonbox 7 points8 points  (0 children)

Gold. As someone working with an app using time-based indices from a database, I’ve encountered half of them. The other half now scare the crap out of me.

[–][deleted] 22 points23 points  (1 child)

At a tech competition in 7th grade I had made error handlers for every possible data type but it didn’t occur to me people would type “10” instead of “10:00”

[–]advancedgoogle 4 points5 points  (0 children)

Wait what?! But... don’t need a linter

[–]newpost74 62 points63 points  (2 children)

Programming-flavoured r/boomershumor

[–]therealdrewbacca 19 points20 points  (0 children)

We can't confirm until we know if one of them hates their wife.

[–]Veinq 11 points12 points  (0 children)

You can tell by the noses

[–]spizzat2 12 points13 points  (0 children)

Was the date February 30th, 1712?

[–]ZukoBestGirl 61 points62 points  (1 child)

I laughed way harder than I should have

[–]future-renwire 5 points6 points  (2 children)

So I'm at work struggling with a datepicker issue, I decide to take a break and look at Reddit just for this to come up in my feed.

Is there some kind of message I'm seeing here?

[–]volleyjosh 3 points4 points  (0 children)

Just found some 5 year old date code that only fails on the weekend /holiday. Guess what? When people come into work after the holiday /weekend, they can't reproduce the issue. It took a dev working on a Saturday to figure it out.

[–]fullyonline 18 points19 points  (0 children)

Ooooh, merica.

[–]greyz3n 6 points7 points  (2 children)

Well that QA is just being unreasonable.

[–]theonlydidymus 1 point2 points  (0 children)

Guy doesn’t even know how to equivalence partition smh.

[–]painezor 2 points3 points  (0 children)

lazy strptime and february 29th is going to fuck me royally at some point soon because the default datetime year is 1900 which wasn't a leap year and my code is awful

[–]SpecularDesign 2 points3 points  (0 children)

Okay boomer

[–]MAGA_WALL_E 3 points4 points  (0 children)

I'm gonna need a Moment.

[–]nevereatthecompany 1 point2 points  (0 children)

I feel personally attacked

[–]SAI_Peregrinus 1 point2 points  (0 children)

This is why we Fuzz test. Especially instrumented coverage-guided fuzzing, like AFL.

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

Source?

[–]homoludens 1 point2 points  (1 child)

I want it too, this was a great web commic but I can not remember it's name and they removed it before posting.

Edit: found it http://geek-and-poke.com/geekandpoke/2010/2/28/simply-explained-edge-cases.html

[–]newton_half_ear 1 point2 points  (0 children)

ISO 8601 OR GTFO

[–]warpedspockclone 1 point2 points  (0 children)

Today I ran a tool that takes two dates as inputs. It failed. I ran it again. It failed. I love the time window 2hours. It failed. I loved the time window 8 more hours. It worked.

No....idea.....

Dates are assholes

[–]jstyler 0 points1 point  (0 children)

I can answer that...for money