zoukankan      html  css  js  c++  java
  • Timestamp 使用

    Timestamp是一个长整形的类型

    1.使用方法一

    Timestamp nowdate1 = new Timestamp(System.currentTimeMillis()); System.out.println("System.currentTimeMillis():"+nowdate1);

    2. 使用方法二

    Date date = new Date();   
          Timestamp nowdate2 = new Timestamp(date.getTime());
      System.out.println("new Date():"+nowdate2)
    

    3. 使用方法三

    SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
      Timestamp nowdate = new Timestamp(System.currentTimeMillis());
      String datestr = sdf.format(nowdate);
      System.out.println(datestr);
    
     
     
    如对您有帮助,请多多支持,谢谢。
     
     

  • 相关阅读:
    permute
    ind2sub
    randi( )函数--MATLAB
    ABAQUS复合材料
    matlab中fix函数,floor函数,ceil函数
    在windows10中卸载软件和取消开机启动程序
    在linux的tomcat中配置https及自动跳转
    解决ubuntu无法远程连接
    谷歌浏览器 插件安装配置Momentum chrome
    0903——元类
  • 原文地址:https://www.cnblogs.com/chaoren399/p/5158975.html
Copyright © 2011-2022 走看看