先看一个代码示例: import java.text.SimpleDateFormat; import java.util.Date; public class test{ public static void main(String args[]) { Date newTime = new Date(); //设置时间格式 SimpleDateFormat sdf1 = new SimpleDateFormat("y-M-d h:m:s a E"); SimpleDateFormat
Date日期类 Date表示特定的时间,精确到毫秒; 构造方法: public Data() public Date(long date) 常用方法: public long getTime() public void setTime(long time) public Boolean before(Date when) public Boolean after(Date when) public int compareTo(Date anotherDate) public String toS
用POI读取Excel数据:(版本号:POI3.7) 1.读取Excel private List<String[]> rosolveFile(InputStream is, String suffix, int startRow) throws IOException, FileNotFoundException { Workbook xssfWorkbook = null; if ("xls".equals(suffix)) { xssfWorkbook = new H
import net.sf.json.JSONObject; import net.sf.json.JsonConfig; import net.sf.json.processors.JsonValueProcessor; public class DateJsonValueProcessor implements JsonValueProcessor { public static final String DEFAULT_DATE_PATTERN = "yyyy-MM-dd HH:mm:ss