Insert time format
P粉124070451
P粉124070451 2023-09-09 18:44:15
0
1
570

I need help on the best data type and format needed to insert times into a table.

For example, I have a table FLIGHT in which I want to insert flight arrivals and flight departures so that it looks exactly like this

flightArrival                    flightDepature
7:00AM                          2:00PM

What format do I need to get this?

I used data type "time" and it doesn't work on my SQL. So I tried the TIMESTAMP data type and used this format TO_TIMESTAMP('07:00:00', 'hh24:mi:ss') and it gave me something else that I have posted Screenshot below.

What data types and formats can I use to insert into my table to get accurate output?

Using TIME data type, it didn't work at all, then I tried TIMESTAMP TO_TIMESTAMP('07:00:00', 'hh24:mi:ss') to try to enter the time, but it gave me different output. It gives me 01-JUL-23 07.00.00.000000000 AM instead of 07:00AM

P粉124070451
P粉124070451

reply all(1)
P粉809110129

You should call date_format to format the datetime data as needed.

Tip: Look for the %r flag.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!