Re: [go-nuts] time: error prone implementation of Time.Format

2017-03-30 Thread Manlio Perillo
Il giorno giovedì 30 marzo 2017 17:28:47 UTC+2, Ian Lance Taylor ha scritto: > > > [...] > >> But it's not clearly incorrect to write > >> > >> "2006-01-02 or Jan 02, 2006" > >> > > > > I'm probably missing something, but "2006-01-02" is a valid time layout > > string. > > I'm presenting tha

Re: [go-nuts] time: error prone implementation of Time.Format

2017-03-30 Thread Ian Lance Taylor
On Thu, Mar 30, 2017 at 7:49 AM, Manlio Perillo wrote: > Il giorno giovedì 30 marzo 2017 01:21:14 UTC+2, Ian Lance Taylor ha scritto: >> >> On Wed, Mar 29, 2017 at 2:29 PM, Manlio Perillo >> wrote: >> > Il giorno mercoledì 29 marzo 2017 23:18:09 UTC+2, Ian Lance Taylor ha >> > scritto: >> >> >> >

Re: [go-nuts] time: error prone implementation of Time.Format

2017-03-30 Thread David Collier-Brown
I think he said "02/02/2006", and got two day-numbers instead of a day and a month. --dave On Thursday, March 30, 2017 at 10:49:29 AM UTC-4, Manlio Perillo wrote: > > Il giorno giovedì 30 marzo 2017 01:21:14 UTC+2, Ian Lance Taylor ha > scritto: >> >> On Wed, Mar 29, 2017 at 2:29 PM, Manlio Per

Re: [go-nuts] time: error prone implementation of Time.Format

2017-03-30 Thread Manlio Perillo
Il giorno giovedì 30 marzo 2017 01:21:14 UTC+2, Ian Lance Taylor ha scritto: > > On Wed, Mar 29, 2017 at 2:29 PM, Manlio Perillo > > wrote: > > Il giorno mercoledì 29 marzo 2017 23:18:09 UTC+2, Ian Lance Taylor ha > > scritto: > >> > >> On Wed, Mar 29, 2017 at 2:03 PM, Manlio Perillo > >> wr

Re: [go-nuts] time: error prone implementation of Time.Format

2017-03-30 Thread Manlio Perillo
Certainly this is a bug that can be found with unit test, however catching a bug early is always better, if this is possible. Manlio Il giorno giovedì 30 marzo 2017 13:18:35 UTC+2, rog ha scritto: > > Isn't this the kind of thing we write tests for? > > On 29 Mar 2017 22:03, "Manlio Perillo"

Re: [go-nuts] time: error prone implementation of Time.Format

2017-03-30 Thread David Collier-Brown
>From your described implementation, I assume you're asking for something like As a programmer, if I ask for a date with month twice, I wish to revieve a warning" If so, it would complain if I asked to print something like "01/01/2017 (1 Jan 2017)" --dave -- You received this message be

Re: [go-nuts] time: error prone implementation of Time.Format

2017-03-30 Thread David Collier-Brown
>From your described implementation, I assume youre asking for On Wednesday, March 29, 2017 at 5:29:19 PM UTC-4, Manlio Perillo wrote: > > Il giorno mercoledì 29 marzo 2017 23:18:09 UTC+2, Ian Lance Taylor ha > scritto: >> >> On Wed, Mar 29, 2017 at 2:03 PM, Manlio Perillo >> wrote: >> > In

Re: [go-nuts] time: error prone implementation of Time.Format

2017-03-30 Thread roger peppe
Isn't this the kind of thing we write tests for? On 29 Mar 2017 22:03, "Manlio Perillo" wrote: > In a program I have a function that formats the time in Italian date > format: dd/mm/, but, due to an oversight, I wrote the layout string as > "02/02/2006", instead of "02/01/2006". > This cause

RE: [go-nuts] time: error prone implementation of Time.Format

2017-03-29 Thread John Souvestre
@googlegroups.com] On Behalf Of Ian Lance Taylor Sent: 2017 March 29, Wed 18:21 To: Manlio Perillo Cc: golang-nuts Subject: Re: [go-nuts] time: error prone implementation of Time.Format On Wed, Mar 29, 2017 at 2:29 PM, Manlio Perillo wrote: > Il giorno mercoled� 29 marzo 2017 23:18:09 UTC+2, Ian La

Re: [go-nuts] time: error prone implementation of Time.Format

2017-03-29 Thread Ian Lance Taylor
On Wed, Mar 29, 2017 at 2:29 PM, Manlio Perillo wrote: > Il giorno mercoledì 29 marzo 2017 23:18:09 UTC+2, Ian Lance Taylor ha > scritto: >> >> On Wed, Mar 29, 2017 at 2:03 PM, Manlio Perillo >> wrote: >> > In a program I have a function that formats the time in Italian date >> > format: >> > dd/

Re: [go-nuts] time: error prone implementation of Time.Format

2017-03-29 Thread Manlio Perillo
Il giorno mercoledì 29 marzo 2017 23:18:09 UTC+2, Ian Lance Taylor ha scritto: > > On Wed, Mar 29, 2017 at 2:03 PM, Manlio Perillo > > wrote: > > In a program I have a function that formats the time in Italian date > format: > > dd/mm/, but, due to an oversight, I wrote the layout string a

Re: [go-nuts] time: error prone implementation of Time.Format

2017-03-29 Thread Ian Lance Taylor
On Wed, Mar 29, 2017 at 2:03 PM, Manlio Perillo wrote: > In a program I have a function that formats the time in Italian date format: > dd/mm/, but, due to an oversight, I wrote the layout string as > "02/02/2006", instead of "02/01/2006". > This caused all the dates to be incorrectly formatte

[go-nuts] time: error prone implementation of Time.Format

2017-03-29 Thread Manlio Perillo
In a program I have a function that formats the time in Italian date format: dd/mm/, but, due to an oversight, I wrote the layout string as "02/02/2006", instead of "02/01/2006". This caused all the dates to be incorrectly formatted. IMHO, this is a nasty behavior. The layout is clearly inc