Hi all,

I have a question regarding the usage & implementation of SqlFunctions.
internalToTimestamp(long v) (I copied the implementation below). I want to
clarify the definition of input parameter v. Is it milliseconds since
epoch, or something else?

If it is milliseconds since epoch, why do we need to minus it with LOCAL_TZ
.getOffset(v)before passing it to the sql.Timestamp constructor. As
documented in the sql.Timestamp constructor, the constructor also takes
milliseconds since epoch. So it seems to me that the current implementation
is wrong unless I misunderstood the definition of input parameter v or I
don't have enough context. I am also happy to fix it or improve it if it's
a bug. Thanks a lot.

public static java.sql.Timestamp internalToTimestamp(long v) {
  return new java.sql.Timestamp(v - LOCAL_TZ.getOffset(v));
}


Shuyi

Reply via email to