Converting date string to tdatetime (varied date format entry)
Posted on 2004-04-10
I would like to find a function that would allow user to enter a date into an edit box in the format of any of these: mm/dd/yy or m/d/y or mm/dd/yyyy or m/d/yy, etc. and return a valid tdatetime, or return false if unable to convert to a tdatetime. I've tried to figure it out by looking at the date formatting stuff in Delphi 6, but I'm so confused now I thought I'd go to the experts.
I would think this would be an often-used function.
Can you steer me towards the answer? Thanks.