![]() Operating across time zones, you're fine. Going to carefully review what you wrote, because you put a lot of I apologize in advance if you already answered that question-I'm :) But in the end, all I want to know is that I theįinal long now=System.getCurrentTim eMillis() įinal Timestamp before=new Timestamp(now) įinal Timestamp after=jooqRecord.getTimestamp() ĪssertEqual(before, after) //a timestamp ![]() Lukas, I'll go read your extensive references, which lookĮntertaining. Integer value-and it never, ever, ever changes!! Modifications-independent of the time zone of my database server To make sure is that my Date/Instant is stored and retrieved with no But converting to a local time I can handle. It is only when you want toĬonvert that absolute instant to some local date that you run into The System.getCurrentTimeMillis() is in fact easy. I have co-written aĬomplex time scheduling program which routed appointments of aĬustomer in one time zone to consultants based upon their localĪvailable times in various time zones around the world. I'm fully versed in date, time, and time zones. ![]() Surely I am misinterpreting the situation. It to give us back the same absolute time value? Or is the problem The most advanced and most standards-compliant, and we can't rely on I find that absurd!! We have a database that supposedly is one of That should not be modified by time zones (because it is tied to Inappropriate-System.currentTimeMillis() is an absolute time value Will influence the value I retrieve? But that is Original System.currentTimeMillis()? This is the simplest and mostįundamental time representation that exists.Īre you saying that my time zone setting on my JVM or my database Set(timestamp) a value using jOOQ, and then timestamp=get() onĪnother computer, I can be guaranteed that I will get back the Is there no type I can use in PostgreSQL so that if I Timestamp(System.currentTimeMillis()), that gives me an absoluteĬomputer time. Let me break it down like this: If I construct a Give me a local time, right? I want to store and retrieve anĪbsolute time value-the equivalent to System.currentTimeMillis(). The most important question: if I use jOOQ to store a value in a TIMESTAMP WITH TIMEZONE using a Timestamp, and later if I connect from another time zone and request the Timestamp back, will I get the same absolute (UTC-relative) value I put in? So where does the time zone come in? Is WITH TIMEZONE really required in the type? And if I am saving and retrieving an absolute Instant equivalent (which is locked to UTC), why does the time zone matter?īasically I only care about time zones as far as retrieving the exact same absolute time value I started with. ![]() When I query the value I get back a Timestamp, which again is equivalent (and convertible to) a Java 8 instant. I note that jOOQ takes a long absolute time value (which is independent of time zone by nature of its being locked to UTC-and equivalent to Java 8 Instant) to store a Timestamp in a TIMESTAMP WITH TIMEZONE column. I saw several (old) discussions here and elsewhere about jOOQ problems with PostgreSQL TIMESTAMP WITH TIMEZONE, including. I'm no SQL expert but I do know my way around Java times, dates, time zones, and Joda.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |