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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • raj0390
    New Member
    • May 2009
    • 2

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

    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
  • shash141183
    New Member
    • Jul 2009
    • 2

    #2
    Try this... but I am not sure whether it will work....
    select date('Apr 19 20:00:03 CDT 2009')
    from sysibm.sysdummy 1

    Comment

    • docdiesel
      Recognized Expert Contributor
      • Aug 2007
      • 297

      #3
      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

      Comment

      Working...