Thanks for the answer. I believe it would be nice if custom formats can be added by developers. Does it make sense to create a pull request for time/format to allow developers add custom formats?
Custom formats can be defined if I could extend `nextStdChunk` (extracting `std` from layouts) and a part of `AppendFormat` (converting `std` to outputs). So I plan to extract and export those two functions, and provide alternate `Format` (e.g. `FormatWithCustomStd) that receives customized version of them. Or should it be provided as some third-party library? Regards, Ikedam 2017年7月2日日曜日 1時18分14秒 UTC+9 Sam Whited: > > On Sat, Jul 1, 2017 at 11:01 AM, Sam Whited <s...@samwhited.com > <javascript:>> wrote: > > Check out the documentation for the "Format" function: > > Follow up because I only answered part of the question (my apologies): > unfortunately, while Format does allow you to add custom formats, it > won't let you change the padding for 24-hour formats. You could always > format a simple timestamp like this using the generic string > formatting methods: > > fmt.Println(fmt.Sprintf("%d:%02d", t.Hour(), t.Minute())) > > —Sam > -- 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. For more options, visit https://groups.google.com/d/optout.