简体   繁体   中英

Can I format TIME data type on JavaDB?

I have a TIME data type column in my database. According to this , it supports hh[:mm] {AM | PM} format. But when I tried insert this sql :

INSERT INTO POSISI (ID, TUJUAN, PELABUHAN_TERAKHIR, LATLNG, AREA, KECEPATAN, HALUAN, STATUS, KETERANGAN, WAKTU, JAM) VALUES ((SELECT ID FROM KAPAL WHERE UPPER(KAPAL.NAMA)=UPPER('Aura Kasih')), 'Surabaya', 'Karimun', '2.02, 100.2', 'Kiclik', '19 knot', '11°', 'Anchor', 'Aman', '2014-03-16', '01:50 AM')

I got this on my database :

2 | Surabaya | Karimun | 2.02, 100.2 | Kiclik | 19 knot | 11° | Anchor | Aman | 2014-03-16 | 01:50:00

As you can see, I am using 01:50 AM but it stored as 01:50:00 .

So, can I tell JavaDB to store TIME as hh:mm a format?

Thank you.

Time will always be stored as hh:mm:ss in the db. The format that you mentioned is for the input. You will need to format the time again when you want to retrieve / display from the db.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM