Hi Gurus,
I've input date coming in all the different format , our requirement is to convert the date in YYYY-MM-DD format.
I tried using Iconv, Oconv combination but it fails at some point.
Wondering if there is any code available or I've tocreate a routine with case statement.
Thanks
Multiple date format
Moderators: chulett, rschirm, roy
YYYY-MM-DD
MM-DD-YYYY
DD-MM-YYYY
MM/DD/YYYY
DD/MM/YYYY
I need to check if its YYYY-MM-DD then ok otherwise conver it to YYYY-MM-DD
Regards
MM-DD-YYYY
DD-MM-YYYY
MM/DD/YYYY
DD/MM/YYYY
I need to check if its YYYY-MM-DD then ok otherwise conver it to YYYY-MM-DD
Regards
DSguru2B wrote:What are all the possible formats? Can you provide a list. ICONV with Date option should work for most of them. Thats why I requested for a list of all formats so that the odd one out can be factored in.
You will have to request for a consistent format. This is going to be a challenge as per programming. For example, how can you tell which part is day and which part is month in "01/01/2004". It could be either DD/MM/YYYY or MM/DD/YYYY.
You will have to either ask for a consistent date format per dataset.
You will have to either ask for a consistent date format per dataset.
Creativity is allowing yourself to make mistakes. Art is knowing which ones to keep.
That what I was trying to do nut not succesful as how can you tell Iconv function that its particular format if not then go to next condition.
It might be simple but not clicking to me![Sad :-(](./images/smilies/icon_sad.gif)
Thanks
It might be simple but not clicking to me
![Sad :-(](./images/smilies/icon_sad.gif)
Thanks
Titto wrote:I think if you know the number of distinct format then using iconv and if condition change the target format.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact: