Alexander Stolte Expert Licensed User Longtime User Jul 22, 2019 #1 Hey, i have a timestamp type on my postgresql table, if i get this timestamp with jRDC2 then i got this number: B4X: 1555950426000 If i do a select on this table, the timestamp are: B4X: 2019-04-22 06:27:06 is this a bug or a feature of jRDC2?
Hey, i have a timestamp type on my postgresql table, if i get this timestamp with jRDC2 then i got this number: B4X: 1555950426000 If i do a select on this table, the timestamp are: B4X: 2019-04-22 06:27:06 is this a bug or a feature of jRDC2?
OliverA Expert Licensed User Longtime User Jul 22, 2019 #2 That's the time/date in milliseconds. Your select statement may make it human readable and the underlying JDBC driver just returns milliseconds. Besides jRDC2 using JDBC, it is not a bug/feature of jRDC2 (it's how the underlying JDBC works). Upvote 0
That's the time/date in milliseconds. Your select statement may make it human readable and the underlying JDBC driver just returns milliseconds. Besides jRDC2 using JDBC, it is not a bug/feature of jRDC2 (it's how the underlying JDBC works).
Alexander Stolte Expert Licensed User Longtime User Jul 22, 2019 #3 hmm, then really every jdbc driver is different, with MySql this was never the case. Thanks. Upvote 0
Alexander Stolte Expert Licensed User Longtime User Jul 22, 2019 #4 But on online tools like http://www.datetimetoticks-converter.com/ or http://tickstodatetime.azurewebsites.net/ i got this result: 02/01/0001 19:13:43 Upvote 0
But on online tools like http://www.datetimetoticks-converter.com/ or http://tickstodatetime.azurewebsites.net/ i got this result: 02/01/0001 19:13:43
OliverA Expert Licensed User Longtime User Jul 22, 2019 #5 https://github.com/pgjdbc/pgjdbc/bl...ava/org/postgresql/jdbc/PgResultSet.java#L576 That is exactly what the driver does, it returns milliseconds Upvote 0
https://github.com/pgjdbc/pgjdbc/bl...ava/org/postgresql/jdbc/PgResultSet.java#L576 That is exactly what the driver does, it returns milliseconds
OliverA Expert Licensed User Longtime User Jul 22, 2019 #8 If you got a string back from MySQL, then use SQL to format PostgreSQL’s output the same instead of handling milliseconds in your client app. Upvote 0
If you got a string back from MySQL, then use SQL to format PostgreSQL’s output the same instead of handling milliseconds in your client app.
Erel B4X founder Staff member Licensed User Longtime User Jul 23, 2019 #9 This number is actually what is named ticks in B4X world. B4X: Dim ticks As Long = 1555950426000 Log($"$DateTime{ticks}"$) It is the number of milliseconds since 1/1/1970 00:00 UTC. Worth watching: https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=256970493 Upvote 0
This number is actually what is named ticks in B4X world. B4X: Dim ticks As Long = 1555950426000 Log($"$DateTime{ticks}"$) It is the number of milliseconds since 1/1/1970 00:00 UTC. Worth watching: https://www.b4x.com/etp.html?vimeography_gallery=1&vimeography_video=256970493