B4J Question jRDC2 result is a number instead of timestamp [postgresql]

Discussion in 'B4J Questions' started by Alexander Stolte, Jul 22, 2019.

  1. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    Hey,

    i have a timestamp type on my postgresql table, if i get this timestamp with jRDC2 then i got this number:
    Code:
    1555950426000
    If i do a select on this table, the timestamp are:
    Code:
    2019-04-22 06:27:06
    is this a bug or a feature of jRDC2?
     
  2. OliverA

    OliverA Well-Known Member Licensed User

    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 likes this.
  3. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    hmm, then really every jdbc driver is different, with MySql this was never the case. Thanks.
     
  4. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

  5. OliverA

    OliverA Well-Known Member Licensed User

    Alexander Stolte likes this.
  6. OliverA

    OliverA Well-Known Member Licensed User

    It’s milliseconds, not ticks
     
    Alexander Stolte likes this.
  7. Alexander Stolte

    Alexander Stolte Well-Known Member Licensed User

    ahhhh,yes. Thanks! :)
     
  8. OliverA

    OliverA Well-Known Member Licensed User

    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.
     
    Alexander Stolte likes this.
  9. Erel

    Erel Administrator Staff Member Licensed User

    Alexander Stolte likes this.
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice