Unix Technical Forum

Date conversion and SPL

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 ...


Go Back   Unix Technical Forum > Database Server Software > Informix

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-19-2008, 08:51 PM
Paul Watson
 
Posts: n/a
Default Date conversion and SPL

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 #
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008, 08:51 PM
Art S. Kagel
 
Posts: n/a
Default Re: Date conversion and SPL

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
>

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 08:41 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com