Effective String to Date conversion?
Steven Schveighoffer
schveiguy at gmail.com
Wed Jan 31 20:34:31 UTC 2024
On Monday, 22 January 2024 at 10:56:04 UTC, atzensepp wrote:
> Dear D-gurus,
>
> being new to D I am trying my first steps and the language is
> quite intuitive and appealing.
> When reading a file and creating a hash for the reocrds I want
> to get only the most recent ones. For this I need to convert
> Date/Time-Strings to comparable DateTime-Objects.
> The code below works but looks a bit clumsy. Is there a more
> efficient (shorter) way to accomplish this?
That's how I would do it also.
I would note there also is a library I've used which works pretty
well:
https://code.dlang.org/packages/dateparser
-Steve
More information about the Digitalmars-d-learn
mailing list