Translating with DrWatson… this can take a few seconds the first time.
This is a genuine, complex translation. DrWatson protects commands, error codes, and log output while naturally translating the surrounding text. It’s translated once and saved.
Paul Watson — — source: Usenet: comp.databases.informix
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 #
↪ replying to Paul Watson
Art S. Kagel — — source: Usenet: comp.databases.informix
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
>
We use strictly necessary cookies to make this site work. With your
consent we’d also use optional cookies for analytics and marketing. You can accept all,
reject all, or choose. Read our Cookie Policy.