Stringtotimestamp

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
cpp
Participant
Posts: 3
Joined: Fri Aug 21, 2009 8:09 am
Location: Mysore

Stringtotimestamp

Post by cpp »

Hi,

I've data like 2/19/2008 2:59:26 PM from a varchar source field. I need to convert this to timestamp.
I tried using the following format - StringToTimestamp(string,"%dd/%mm/%yyyy %hh:%nn:%ss") but not sure how to specify AM or PM in the format.
Please help.
Kryt0n
Participant
Posts: 584
Joined: Wed Jun 22, 2005 7:28 pm

Post by Kryt0n »

if you have date 2/19/2008 then "%dd/%mm/%yyyy" isn't going to work for a start...

that aside, your time will need to be something like "%H:%mm:%dd %aa"

%H because you have a variable width 12-hour format
%aa for the am/pm marker
Post Reply