I'm trying to insert to database the current date and time, but inserts only date.
Column Data Type: Date
Format mask: YYYY/MM/DD HH24:MI:SS.
PL/SQL Expression TO_CHAR(SYSDATE,'YYYY/MM/DD HH24:MI:SS')
or to_char(sysdate,'YYYY/MM/DD HH24:MI:SS')
Data inserts automatically when form is submitted (I seted column name and data type (date)).
How to insert date and time correctly?
0
votes
Best practice is to use a trigger to record a sysdate/systimestamp.
– Koen Lostrie
Thank you. I try it.
– ES.
1 Answers
0
votes
You can actually just insert SYSDATE. sysdate is a Date data type, so is the column. One think though, when you then do a Select on the column, it only shows the date, not the time. Thats just because thats the default display mask for the date. in you do a TO_CHAR in the select, you get the time out as well.