获取当前时间 func Now func Now() Time 1 Now returns the current local time. func (Time) UTC func (t Time) UTC() Time 1 UTC returns t with the location set to UTC. func (Time) Unix func (t Time) Unix() int64 1 Unix returns t as a Unix time, the number of se…
项目中遇到了从服务器获取时间,现在记录一下方便以后查询: 1.后台代码:(创建一个date对象并以JSON的形式返回去) // 获取服务器时间 public String getNowServerTime() { result = new HashMap<String, Object>(); result.put("nowTime", new Date()); return SUCCESS; } 2.JS获取时间的函数:(对返回的结果做处理,去掉T,并且将-替换为/.处理浏…