cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

hi all,

I have to insert date and time to oracle db from pi and it has a format

mm/dd/yyyy hh:mm:ss am

or

mm/dd/yyyy hh:mm:ss pm

how can i achieve this in PI .how can i get time in 12 hr format...

thanks,

sahana

0 Likes
View Entire Topic
Former Member
0 Likes

Hi,

Try with this little UDF (assuming that input is your input variable):

Date date = DateFormat.parse(input);
DateFormat df = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss a"); 
return df.format(date);

Hope this helps,
Greg