Connecting Tech Pros Worldwide Forums | Help | Site Map

convert 'Apr 19 20:00:03 CDT 2009' string to date

Newbie
 
Join Date: May 2009
Posts: 2
#1: May 19 '09
hi ,

i am unable to convert'Apr 19 20:00:03 CDT 2009' which is a string to a valid date format plz let me know the function

Newbie
 
Join Date: Jul 2009
Location: India
Posts: 2
#2: Jul 18 '09

re: convert 'Apr 19 20:00:03 CDT 2009' string to date


Try this... but I am not sure whether it will work....
select date('Apr 19 20:00:03 CDT 2009')
from sysibm.sysdummy1
docdiesel's Avatar
Moderator
 
Join Date: Aug 2007
Location: Munich
Posts: 289
#3: Jul 21 '09

re: convert 'Apr 19 20:00:03 CDT 2009' string to date


Hi,

that won't do. The string must be in one of the following formats:
  • "2009-06-25-16.12.30.000000"
  • "2009-06-25"
  • "25-06-2009"
Try to chop and rearrange the string by using substr() and maybe replace() for the month' name.

Regards


Doc
Reply