Link to home
Start Free TrialLog in
Avatar of 96gtjeff
96gtjeff

asked on

Converting a numeric date to written english

Hey guys, I am writing a program that will accept a date in the MM/DD/YYYY format and return it in written english...EX: March Fifth, Two Thousand Two

I have the program working from 1990 through now, including filtering out erroneous dates...such as the 29th of February on a non-leap year.  So far I have been converting everything through a CASE SWITCH statement

EX:  CASE 1990: return "nineteen-ninety";

Here's the problem...I want this program to perform this function at least back to 1900...or earlier would be better.  I cannot figure out a way to write these year statements without typing out every single year that I want to have available.  What would be a good way of going about this?

Thanks in advance,

Jeff
Avatar of Axter
Axter
Flag of United States of America image

You could just make a string for each two digit number from 0 to 19.
Then use a dual algrithm to come up with the numbers from 20 to 99
ASKER CERTIFIED SOLUTION
Avatar of Peter Kwan
Peter Kwan
Flag of Hong Kong image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of 96gtjeff
96gtjeff

ASKER

Thank you very much...this oughta do it.