This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-12-08
Channels
- # adventofcode (55)
- # announcements (21)
- # babashka (20)
- # beginners (89)
- # calva (21)
- # cider (16)
- # circleci (11)
- # clara (8)
- # clj-kondo (6)
- # clojure (31)
- # clojure-australia (3)
- # clojure-europe (17)
- # clojure-nl (5)
- # clojure-uk (10)
- # clojurescript (25)
- # community-development (4)
- # conjure (12)
- # cryogen (28)
- # cursive (21)
- # datomic (7)
- # deps-new (1)
- # depstar (45)
- # emacs (5)
- # fulcro (46)
- # instaparse (5)
- # jobs (5)
- # jobs-discuss (23)
- # kaocha (12)
- # lambdaisland (2)
- # leiningen (1)
- # meander (10)
- # mid-cities-meetup (1)
- # reagent (5)
- # reitit (5)
- # remote-jobs (45)
- # reveal (9)
- # sql (6)
- # tools-deps (103)
- # uncomplicate (1)
- # xtdb (1)
Hi, I asked this question: https://clojurians.slack.com/archives/C053AK3F9/p1607425780127500 about weird BC date conversion when querying postgres using clojure.java.jdbc and was pointed here. It may be an issue with the postgres JDBC driver https://github.com/pgjdbc/pgjdbc but wanted to see if anyone had any insight before I have to delve into code!
Thanks
@dstephens Hmm, I haven't heard of anyone trying to use BCE dates with JDBC at all. goes to Bing Hmm, looks like numerous JDBC drivers have problems with that, historically, although some of those got logged as bugs and fixed. One thing you might try is calling .getTime
on the value you get back to see whether the era is just being lost in printing.
Thanks for that, I checked .getTime and it does appear to be negative so that's very useful! Strange that the .toLocalDate method gives back answers that don't line up with the underlying Date class at all but as you say, likely just something most people don't come across.
so as you expected, seems the printing removes the era, the underlying julian calendar date is correct, as is the time, unfortunately I haven't found a nice conversion from the epochMillis to a local date again that lines up quite right, but it's close enough for my purposes!
Thanks for the help!