Weird way how Dates are handled in APEX?
libranJun 7 2007 — edited Jun 8 2007Hi
APEX 2.1.x, 10g XE, Windows XP
I am facing a unique situation, when I am trying to save a date value (with its time component) in APEX. The time portion (hours, minutes and AM/PM) are accepted into separate text variables by the user. My Date column A_Time is a hidden column on the form, whose value is computed via a pl/sql expression, after SUBMIT.
The date part of the A_Time is derived from an already populated another date field on the form.
My PL/SQL computation expression for A_Time is as below
to_date(:P1_EXISTING_DATE||' '||:P1_ARRIVAL_HOUR||':'||:P1_ARRIVAL_MINUTE||:P1_ARRIVAL_AMPM,'DD-MON-YYYY HH:MIPM');
It is storing the date part but completely ignoring the time part (hours,mints am/pm values). Looks like theres trunc happening behind the scenes may be?
Is this a weird way that APEX behaves? I am curious to know if anyone had the similar issue or is it something thats happening at my end?
Thanx
Suma
to_dateTO_CHAR(TO_DATE(:P1_REPORT_DATE||' '||:P1_ARRIVAL_HOUR||':'||:P1_ARRIVAL_MINUTES||:P1_ARRIVAL_AMPM,'DD-MON-YYYY HH:MIPM'),'DD-MON-YYYY HH:MIPM');