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!