Re: SysTime.fromISOString

2017-05-13 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2017-05-13 at 05:03 -0700, Jonathan M Davis via Digitalmars-d- learn wrote: > […] > SysTime st; > try > { > // If it's -MM-DDTHH:MM:SS.FFFZ > // If it's -MM-DDTHH:MM:SS.FFZ > // If it's -MM-DDTHH:MM:SS.FZ > // If it's -MM-DDTHH:MM:SS.Z >

Re: SysTime.fromISOString

2017-05-13 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2017-05-13 at 05:30 -0700, Jonathan M Davis via Digitalmars-d- learn wrote: > > […] I can see I am not going to win the -MM discussion so I'll stand down. Until I have read the latest version of the standard – I remain sure this is a reduced accuracy not a truncated representation. Bu

Re: SysTime.fromISOString

2017-05-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, May 13, 2017 12:56:31 Russel Winder via Digitalmars-d-learn wrote: > On Sat, 2017-05-13 at 04:24 -0700, Jonathan M Davis via Digitalmars-d- > > learn wrote: > > […] > > > > -MM is still truncated and therefore only permitted if > > applications > > agree to it. > > But didn't that

Re: SysTime.fromISOString

2017-05-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, May 13, 2017 12:31:38 Russel Winder via Digitalmars-d-learn wrote: > And this seems awkward: > > > auto date = Clock.currTime(); > auto date_buffer = date.toISOString(); > … > try { > date = SysTime.fromISOString(date_buffer); > } catch (DateTimeException dte) { >

Re: SysTime.fromISOString

2017-05-13 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2017-05-13 at 04:24 -0700, Jonathan M Davis via Digitalmars-d- learn wrote: > […] > > -MM is still truncated and therefore only permitted if > applications > agree to it. But didn't that come is as standard in the 2000 standard along with -- MM-DD for yearless date? > > For times hh:

Re: SysTime.fromISOString

2017-05-13 Thread Russel Winder via Digitalmars-d-learn
And this seems awkward: auto date = Clock.currTime(); auto date_buffer = date.toISOString(); … try { date = SysTime.fromISOString(date_buffer); } catch (DateTimeException dte) { try { date = SysTime(DateTime.f

Re: SysTime.fromISOString

2017-05-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, May 13, 2017 12:06:57 Russel Winder via Digitalmars-d-learn wrote: > On Sat, 2017-05-13 at 01:52 -0700, Jonathan M Davis via Digitalmars-d- > learn wrote: > My reading is that -MM is an allowed form: I was wrong to suggest > was allowed. -MM is still truncated and theref

Re: SysTime.fromISOString

2017-05-13 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2017-05-13 at 01:52 -0700, Jonathan M Davis via Digitalmars-d- learn wrote: > […] > The ISO representation of a date is MMDD, and the extended ISO > representation is -MM-DD. would be a truncated > representation. The > standard has language such as "If, by agreement, truncated

Re: SysTime.fromISOString

2017-05-13 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, May 13, 2017 07:33:35 Russel Winder via Digitalmars-d-learn wrote: > A priori I thought 2015 was a perfectly valid ISO8601 date-time > specification. It appears that SysTime.fromISOString disagrees: > > core.time.TimeException@/usr/include/d/std/datetime.d(8553): Invalid > ISO String: