views:

73

answers:

1

Hello, what's the better way of parsing date in Pascal than manually parsing character after character?

Date should be in mm.dd.yyyy format.

+1  A: 

Depends on the compiler used. If you use Delphi have a look at trystrtodate, or (if with a recent Free Pascal) try dateutils.scandatetime

Marco van de Voort
How about original Turbo Pascal 7.0? :) But still, thanks for answer.
mnn
Throw it away, as you should have in 2000. :) Seriously, maybe you can try to convert the FPC scandatetime code. The strings will be limited to 255 chars, but it does not use particularly new dialect, so backporting it to version of the previous century should be possible.
Marco van de Voort
Well I'm not doing anything in Pascal, really :) Only C#. I just need to know how to handle such scenario, when I get it at my exam :)
mnn