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);
    
     
     
    如对您有帮助,请多多支持,谢谢。
     
     

  • 相关阅读:
    [WEB]对于"Refused to execute script from 'http://xx.xx.xx/yy/zz.js' because its MIME type ('') is not executable, and strict MIME type checking is enabled."问题的解决办法
    Linux下为python3.6.5配置环境变量
    Yii2自带验证码实现
    php在Nginx环境下进行刷新缓存立即输出,实现常驻进程轮询。
    php文件锁解决少量并发问题
    过滤各种不合法标签数据
    wampserver下升级php7
    php异步请求(可以做伪线程)
    linux 定时执行shell
    记一次工单排查经历(修改显示时间)
  • 原文地址:https://www.cnblogs.com/chaoren399/p/5158975.html
Copyright © 2011-2022 走看看