×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




The trouble with "unknown" date formats is that you have to start with some assumptions, and then hope they wil hold true.

Your first two examples, 01012008 and 01/01/2008 do not raise any questions.
.
But what would be the case if you were presented with 06122008 or 06/12/2008 - is this date in December or in June?

Looking at your 3rd example, 20080101, what would we do if presented with 20082009 - is this 20th August 2009 or 20th September 2008?

Again, what year, month and day does 07/08/09 if we do not know the date format?.

I know this is not the answer you wanted to hear ...


Regards,
John McKay
www.rpglanguage.com

----- Original Message ----- From: "Mike" <koldark@xxxxxxxxx>
To: "RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
Sent: Thursday, October 23, 2008 3:06 PM
Subject: Figuring out Date Format


Is there an API or a BIF that I can pass in an unknown date format and get
back a date format I can expect? I am seeing how difficult it might be to
allow a user to enter in a date how they want. (ex. '01012008' '01/01/2008'
'20080101') and return *ISO or something else. I could write a subprocedure,
but I thought I would see if there is something out there that would either
make the code easier or eliminate my needing it.

--
Mike Wills
Midrange Programmer/Analyst

Sick of corporate radio and hungry for something new?
http://thenextgenerationofradio.com
Stalking me? http://twitter.com/MikeWills | http://friendfeed.com/mikewills
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.