Home » RDBMS Server » Server Administration » How to store date and time?
How to store date and time? [message #371689] Sun, 26 November 2000 00:12 Go to next message
Pravin Deshmukh
Messages: 8
Registered: October 2000
Junior Member
Hello everybody,
I want to store date and time(HH:MI:SS) together in a column
having datatye as Date f.e. opening and closing date
and time of a Tender.Also i need to retrieve and compare them.
Pl. anybody can help me.
Re: How to store date and time? [message #371693 is a reply to message #371689] Mon, 27 November 2000 05:58 Go to previous message
Babu Paul
Messages: 38
Registered: November 2000
Member
Hi

Basically when you create a table with a column of datatype date, it automatically stores the time component as well. You should be careful enough to store the time component in a date as well without using trunc or to_date formats. I think this is quite straight forward.
To view the time component just inserted, basically you need to alter the session setting the date format to view the time component also.

For example try creating a record with sysdate as a value and alter the session for date format or format the date using to_char function..
try selecting the record inserted, you can see the time component along with the date.

Good Luck!
Babu
Previous Topic: Query/Insert in a view
Next Topic: E-Mail
Goto Forum:
  


Current Time: Sat May 04 13:37:42 CDT 2024