I feel the same way, Jean. I quite don't get it a the first, and still some times i require to look very well to distinguish the layout pattern for the string value beign parsed.
El lunes, 14 de abril de 2014, 10:19:29 (UTC-3), Jean de Klerk escribió: > > In java, we do things like new SimpleDateFormat("HH:mm:ss");. In php, > something like date_parse_from_format("j.n.Y H:iP", $date) or just > strtotime($date). In perl, we create a datetime parser with a pattern that > might look like pattern => '%B %d, %Y %I:%M %p %Z'. And so on and so on. > > However, in go we give it this ambiguous reference time, as in t, err := > time.Parse("2006-01-02 15:04", "2011-01-19 22:15"). > > This seems odd to me. On first glance, I can't tell which is layout and > which is string, but we can move around that. Then, when using it, I'm > uncertain as to how to change formats without looking it up, I'm uncertain > as to whether or not my reference time is supposed to be just random > numbers or if I should specify things like 12-hour time vs 24-hour time, or > if post-1970 is different than pre-1970, and overall I don't understand the > reason why we choose arbitrary numbers instead of the aforementioned > conventions of things like Y-M-d. > > Thanks for any clarification on this. It's very clunky and tricky to use > at the moment, but I'm sure I'd understand it more if I more fully > understood the rational or what this approach solves that the other does > not. > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/39391019-9c6c-4eb4-a7e1-28a86b6bab53%40googlegroups.com.