Question

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.

Était-ce utile?

La solution

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.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top