This is a discussion on Date conversion and SPL within the Informix forums, part of the Database Server Software category; --> Does anybody have a chunk of SPL that will convert a date string into a datetime. The date string ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Does anybody have a chunk of SPL that will convert a date string into a datetime. The date string will always be a valid date but it the date elements might be in any order i.e. Wed 7 Jan 2004 23:10:10 7 Wed January 2004 23:10:10 Wed Jan 7 04 23:10:10 etc I couldn't see anything at iiug Cheers -- Paul Watson # Oninit Ltd # Growing old is mandatory Tel: +44 1436 672201 # Growing up is optional Fax: +44 1436 678693 # Mob: +44 7818 003457 # www.oninit.com # |
| ||||
| On Thu, 08 Jan 2004 05:31:01 -0500, Paul Watson wrote: I posted a YACC/Bison function that can convert just about anything reasonable into an expanded tm structure and a set of conversion functions including one that will convert the tm into a datetime. If you are using IDS 9.xx you could code them into a 'C' UDR in a datablade. I've just never had the need. Get my datefuncs package from the IIUG Repository and call strtomydt() then pass the mydt structure to mydtotidt (or recode a one step function if you want). The underlying getdateandtime() string to tm conversion understands every date/time format I could think of including English and fuzzy dates like: 4PM yesterday January 7, 2004 4 January 2004 last week 5 years ago 5 years ago tuesday and more.... Art S. Kagel > Does anybody have a chunk of SPL that will convert a date string into a > datetime. The date string will always be a valid date but it the date > elements might be in any order i.e. > > Wed 7 Jan 2004 23:10:10 > 7 Wed January 2004 23:10:10 > Wed Jan 7 04 23:10:10 > etc > > I couldn't see anything at iiug > > Cheers > |