Anyone got a quick and easy way to turn a string of a 3 char abbr of a month into a number, ie Jan = 1, Feb = 2, etc.
I was going to make a map, but I was wondering if there is already a function out there to do it.
Printable View
Anyone got a quick and easy way to turn a string of a 3 char abbr of a month into a number, ie Jan = 1, Feb = 2, etc.
I was going to make a map, but I was wondering if there is already a function out there to do it.
Not in any standard library. Someone might have written one.
But the standard library doesn't contain such highly locale-dependent things as month names.
Ok :(
I just didnt want to do any extra work if I didnt have too ;)
It's a real problem with dates. Simply porting your app to German for example would require changes to the month names. That's ok.
Porting the app to Arabic or Hebreic would be a disaster. They use different calendars...
*shutters* Thank god my apps are only used in house
Luckily I found a parser someone else made that did all the hard work for me already. So I am off the hook.
That's why so many methods of the java Date class are deprecated and the Calendar class hierarchy was introduced.
The .Net framework has something similar.