String to TimeStamp along with AM PM

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
srds2
Premium Member
Premium Member
Posts: 66
Joined: Tue Nov 29, 2011 6:56 pm

String to TimeStamp along with AM PM

Post by srds2 »

I have String as Input and have to load it to a TimeStamp(6) in Oracle.
My String is like this:3/31/2011 4:05:23.500000 AM

When I Do the following type conversion
String to TimeStamp(Column,'%m/%d/%yyyy %h:%n:%s.6')
The value 3/31/2011 4:05:23.500000 PM is getting loaded into the database.
It should load AM instead of PM

Can any one help me out with this???

I tried this conversion also
String to TimeStamp(Column,'%m/%d/%yyyy %h:%n:%s.6 %aa'). This gave me an error saying invalid timestamp format.
BI-RMA
Premium Member
Premium Member
Posts: 463
Joined: Sun Nov 01, 2009 3:55 pm
Location: Hamburg

Post by BI-RMA »

So, what was the solution to solve this?
"It is not the lucky ones are grateful.
There are the grateful those are happy." Francis Bacon
srds2
Premium Member
Premium Member
Posts: 66
Joined: Tue Nov 29, 2011 6:56 pm

Post by srds2 »

just used the below conversion String to TimeStamp(Column,'%m/%d/%yyyy %h:%n:%s.6 %aa')
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Re: String to TimeStamp along with AM PM

Post by chulett »

srds2 wrote:I tried this conversion also String to TimeStamp(Column,'%m/%d/%yyyy %h:%n:%s.6 %aa'). This gave me an error saying invalid timestamp format.
So not so invalid after all?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply