📄 staxtimestamp.java
字号:
/*****************************************************************************//* Software Testing Automation Framework (STAF) *//* (C) Copyright IBM Corp. 2002 *//* *//* This software is licensed under the Common Public License (CPL) V1.0. *//*****************************************************************************/package com.ibm.staf.service.stax;import java.util.Calendar;import java.text.SimpleDateFormat;public class STAXTimestamp{ private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd"); private static SimpleDateFormat timeFormat = new SimpleDateFormat("HH:mm:ss"); private static SimpleDateFormat timestampFormat = new SimpleDateFormat("yyyyMMdd-HH:mm:ss"); public STAXTimestamp() { // Gets the current date and time fCalendar = Calendar.getInstance(); } public Calendar getCalendar() { return fCalendar; } public String getTimestampString() { return timestampFormat.format(fCalendar.getTime()).toString(); } public String getDateString() { return dateFormat.format(fCalendar.getTime()).toString(); } public String getTimeString() { return timeFormat.format(fCalendar.getTime()).toString(); } Calendar fCalendar;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -