Hey all,

I'm currently writing a program that will do various things with dates. The problem that I currently have is getting pascal to recognise dates in various formats (eg. 24/09/93 or 09-03-04 or 17 01 99, etc) when input by a user. This data needs to be read by pascal in a way that allows me to alter the output (ie. the date written out in full).

Any suggestions/solutions would be immensely appreciated.

Recommended Answers

All 3 Replies

Take a look through this thread:
Tutorial: Handling Dates and Time in Delphi

Near the bottom there is some thoughts on reading dates (which is the hard part). Writing dates is easy.

Hope this helps.

Thanks for the link/ help, Duoas. I've never used Delphi before, and although I can see the similiarities, I'm generally new to the programming game so I'm having some trouble understanding it.

If you have any words of wisdom in the Pascal programming language, that would be very useful indeed. Thanks again.

Heh, glad to have helped.

I know it takes a while to get your head around it, but the only way it will come is to struggle along... alas. But it will come, don't worry. :)

One of the most overlooked features in Delphi (IMHO) is the use of try...except blocks in data transformation. In simple terms, endeavor to do things one way. If the input doesn't match, raise an exception and catch that to try another way. Keep going until you either run out of ways to try or until the input matches.

Good luck.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.