0
votes

I need to insert date time to an oracle table with php.

my date string is this format:

'2013-10-22 08:02:30', '2013-10-22 13:02:30', '2013-10-22 21:02:30' etc.

When I use this format in php,

$date1=to_date('2013-10-22 08:02:30','YYYY-MM-DD HH24:MI:SS')

I see that the data in the oracle table is in PM format. How is this possible? How can I change the to_date so that anything 12 is am, and any time that is 12 and up is pm?

$date1=to_date('2013-10-22 00:02:30','YYYY-MM-DD HH24:MI:SS')
1

1 Answers

0
votes

Try

$date1 = date("Y-m-d H:i:s", strtotime('2013-10-22 00:02:30'));