⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmpptimestampformat.java

📁 采用JAVA开发
💻 JAVA
字号:
package com.gctech.cmpp3.util;

import java.text.SimpleDateFormat;
import java.text.DateFormat;
import java.util.Date;

/**
 * <p>Title: CNGP API</p>
 * <p>Description: 固网短信SP API</p>
 * <p>Copyright: Copyright (c) 2004</p>
 * <p>Company: GCTECH</p>
 * @author 王红宝
 * @version 1.0
 */

public class CMPPTimestampFormat {
  static CMPPTimestampFormat singleton;
  private DateFormat format;
  CMPPTimestampFormat() {
    format = new SimpleDateFormat("MMddHHmmss");
  }
  public static CMPPTimestampFormat getInstance(){
    if ( singleton == null )
      singleton = new CMPPTimestampFormat();
    return singleton;
  }
  public String currentTimestamp(){
    return format.format(new Date());
  }
  public static void main(String[] args){
    String time = CMPPTimestampFormat.getInstance().currentTimestamp();
    System.out.println(time);
    int ntime = Integer.parseInt(time);
    System.out.println(ntime);
  }

}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -