1.获取当前时间: var now=new Date(); //Tue Oct 17 2017 18:08:40 GMT+0800 (中国标准时间) 获取当前时间的日期 new Date().getDate() //17 new Date().toLocaleString() //2017/10/17 下午6:08:40 2.引用moment.js将标准时间转化成YYYY-MM-DD hh:mm:ss var time=moment(new Date()).format("YYYY-MM
用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
public static String changeCellToString(XSSFCell cell){ String result = "";// Object value = null; DecimalFormat df = new DecimalFormat("#"); if (null != cell) { switch (cell.getCellType()) { case HSSFCell.CELL_TYPE_NUMERIC:// 数字类型 if
首先我们知道,web api 是可以返回任意类型的,然后在输出的过程中转为(默认的)xml. 但是xml是比较费流量的,而且大多前端都是用json对接,所以我们也只能随大流,把它输出改成json. 不废话了,直接上代码,反正就这么点. public static class WebApiConfig { public static void Register(HttpConfiguration config) { config.MapHttpAttributeRoutes(); config.R
传入:Json格式的时间 JS如下: yyyy-M(MM)-d(dd) H(HH):m(mm):s(ss) function timeStamp2String(time) { var data=time; )); var year=datetime.getFullYear(); ; var date=datetime.getDate(); var hour=datetime.getHours(); var minute=datetime.getMinutes(); var second=date