zoukankan      html  css  js  c++  java
  • Java Timestamp Memo

    timestamp的构造函数,把微妙作为纳秒存储,
    所以 Java.util.date.comepareTo(Timestamp) 结果肯定是1
    另外,​Timestamp.equal(object) 如果参数不是Timestamp,肯定返回false。
    Timestamp's nanos value is NOT the number of nanoseconds - it's ananosecond-resolution number of millis (i.e. fractional seconds).As such, in the Timestamp constructor, it is setting the time onthe super to be without milliseconds. Therefore, the Timestamp willalways have a lower value for the member fastTime (used in Date'scompareTo()) than the corresponding Date (unless, of course, it hasno fractional seconds).
     

       publicTimestamp(long time) {
           super((time/1000)*1000);
           nanos = (int)((time00) * 1000000);
           if (nanos < 0) {
               nanos = 1000000000 + nanos;
               super.setTime(((time/1000)-1)*1000);
           }
        }
  • 相关阅读:
    Python学习进程(1)Python简介
    OpenGL学习进程(10)第七课:四边形绘制与动画基础
    OpenGL学习进程(9)在3D空间的绘制实例
    GO语言结构体
    GO指针
    GO值类型与引用类型
    GO函数
    GO map
    GO切片
    GO数组
  • 原文地址:https://www.cnblogs.com/sdfczyx/p/6396702.html
Copyright © 2011-2022 走看看