While I got also shocked at first by Go's time formatting, is by far the easiest to learn and memorize once you get it.<p>The argument from the issue <a href="https://github.com/golang/go/issues/444" rel="nofollow">https://github.com/golang/go/issues/444</a><p>> It would be much easier to port preexisting
code if you could just copy your time formats over.<p>It's not really much of an argument, since transforming the sprintf format to Go is a trivial as printing an specific date.
Personally, when I first read the spec. for time.Format, I thought "well how bleedin' sensible is that?!" The <i>only</i> thing that annoys me is that it isn't in ISO order (I'd have preferred 2001-02-03 14:05:06 ), but all that you need to remember is "2006-01" and the rest just falls naturally into place. I've seen a couple of "complaints" about this over the last few days, and I just don't understand what the problem is. It's logical and neat.
It's unfortunate that languages are so monolithic. You want to make a language that does concurrency differently and you end up having to design date format strings! Sad that we still don't have any kind of common libraries or whatever it might take to just do this a couple of times and let language designers pick and choose the preexisting components they want.
I, for one, deeply appreciate any project which isn't afraid to do things differently when they decide there's a better way. I see it similar to iOS not supporting Flash, or Angular 2.0 rethinking things.<p>You can't change everything, but it's what you do differently that gives your project value.
I personally love the way it works. This is actually one of my arguments in favor of the golang standard library which is, in my opinion, a great piece of software by itself.
The Go date format is one my huge annoyances about the language (not generics, interface{} magic, or the lack of immutable types). My biggest issue is that despite the fact the designers call Strftime bad because no one remembers the letters, and has to have documentation handy - the Go docs don't even document the magic numbers you have to use.<p>Why 2006? How do I represent a day? When do I use _2 vs 2? Its very poorly documented and thankfully all I use is RFC3339 and Unix timestamps.
Strangely the non-profanity version <a href="http://flippinggodateformat.com" rel="nofollow">http://flippinggodateformat.com</a> still has profanity.
I generally agree with Cox but "no one remembers
all the letters, so the only way to use it is with documentation in hand."<p>Huh?<p>Who can remember the numbers? The only way to use this format is with the documentation.<p>It is an easier to read and verify format. However if you think a casual user will remember that "02" is hour and "03" is... wait, is 02 hour? Let me check the documentation.
First: neat, funny ("I can now write Go date format strings...you win this time"), and I follow the "sprintf may be awful but at least I know it" argument.<p>While there's a lot to say for sticking to your language's idioms even when it's a pain, if you <i>really</i> need/want strftime there are third-party libraries:<p><a href="https://github.com/search?l=Go&q=strftime" rel="nofollow">https://github.com/search?l=Go&q=strftime</a>
People who say "he could just use sprintf" are missing the point: this lets you use sprintf <i>while writing idiomatic Go</i>.<p>If I see a Go programmer import a sprintf library just because he doesn't want to conform to the programming environment, that's going to ruffle some feathers during code review.<p>But if he uses this, well, I'd be none the wiser.<p>Readability counts.
I just recently had this problem while working with Hugo, a Go static site generator.<p>Suffice to say, it was not intuitive at all. I had to look at the support forums to learn about this Go eccentricity.<p>I can't say that I hate it. I could probably get used to it.
I was wondering why they didn't borrow java SimpleDateFormat<p>But then I noticed they decided to tackle the dd-MM-yyyyTHH:mm:ss problem AKA crazy case. Which is kind of noble.
I understand there may be legacy issues from other languages, but in a new language... why on earth would you not take the time to make %p the lower case am/pm and %P - AM/PM?
There are two thing I don't like in IT:<p>1- Using names for software that is confusing with names of real things that have nothing to do with it, like Cocoa for a user interface library and so many others.<p>2- Using the terms a two year old will use when she discovers it is funny and gets attention just for saying dirty words.<p>In this particular case, this combines both in one. The first thing I thought was: This will have something to do with dating and having casual sex or something. Then you discover that no, it has nothing to do with it, it is just a two year old like mindset creating a "funny"(for him) name for their pet project.