I am creating a specific app, where I need to set starting and ending times for orders. The problem rises with the DATE datatype format for storing, well, date.
The APEX ORACLE documentation states:
DATE is the oldest and most widely used data type. Though the name is “DATE”, it stores also information about the time.
The issue I face is that, no matter how I try to store it, I can only retrieve the DATE without time (et. 05/10/2024 as MM/DD/YYYY), when looking manually in table ‘data’ or using a quarry.
The passed value is 10-MAY-2024 10:00 and it is converted via
BEGIN
DECLARE
toDate DATE;
BEGIN
toDate := TO_DATE(:START_PICKER, 'DD-MON-YYYY HH24:MI');
INSERT INTO MISENE VALUES (toDate);
END;
END;
When stored as DATE, it returns the before mentioned 05/10/2024.
When stored as TIMESTAMP, it returns 10-MAY-24 10.00.00.000000000 AM, which I can use, but it makes it difficult to work with, as I need to use 24 hour format.
When stored as a VARCHAR2, it returns 5/10/2024 .
If not using conversion TO_DATE
or forcing the toDate DATE;
, it either returns an error, stating that there are non numeric values, or in case of VARCHAR2, the original value (10-MAY-2024 10:00).
Desired result is that it is stored under DATE datatype with time included (24 hour format, if possible), as mentioned in the ORACLE documentation, so I can use it to find values that would not overlap with other order times.