November 27, 2018 What can I use to parse a date string in a custom format? | ||||
---|---|---|---|---|
| ||||
I've been looking for a function or library to parse a date in a custom format (for validation) similar to C#'s [1] TryParseExactbut I couldn't find any. so far I only found fromISOExtString(), and fromSimpleString() which doesn't allow me to set a custom string format. I've looked up at https://code.dlang.org/search?q=date https://code.dlang.org/search?q=date+parsing but to my surpise I didn't find either. Am I using wrong keywords or there's no really such method implemented yet? [1]: https://docs.microsoft.com/en-us/dotnet/api/system.datetime.tryparseexact?redirectedfrom=MSDN&view=netframework-4.7.2#System_DateTime_TryParseExact_System_String_System_String_System_IFormatProvider_System_Globalization_DateTimeStyles_System_DateTime__ |
November 27, 2018 Re: What can I use to parse a date string in a custom format? | ||||
---|---|---|---|---|
| ||||
Posted in reply to PacMan | On Tue, 27 Nov 2018 18:22:17 +0000, PacMan wrote: > I've been looking for a function or library to parse a date in a custom > format (for validation) similar to C#'s [1] > TryParseExactbut I couldn't find any. so far I only found > fromISOExtString(), and fromSimpleString() which doesn't allow me to set > a custom string format. http://code.dlang.org/packages/datefmt didn't do it for you? ...that readme is pretty terrible, granted. |
Copyright © 1999-2021 by the D Language Foundation