Long转换为date
public static void main(String[] args) {
Long time = System.currentTimeMillis();
System.out.println(time);
System.out.println(transferLongToDate("yyyy-MM-dd HH:mm:ss",time));
}
private static String transferLongToDate(String dateFormat, Long millSec) {
SimpleDateFormat sdf = new SimpleDateFormat(dateFormat);
Date date = new Date(millSec);
return sdf.format(date);
}
Long转换为date的更多相关文章
- String强制转换为Date,freemarker标签里date数据的显示问题
String强制转换为Date,freemarker标签里date数据的显示问题 http://blog.sina.com.cn/s/blog_617f5d090101ut63.html (2014- ...
- Oracle 日期型 将timestamp类型转换为date类型
Oracle将timestamp类型转换为date类型有三种方法 1.使用to_char先转为字符型,在使用to_date再转为日期型 select to_date(to_char(systimest ...
- mybatis如何接收字符串转换为date类型插入数据库
今天遇到一个问题,先描述一下: 后台获取数据,有一个字段是时间字段,后台传过来的是字符串类型的,如:2016/11/16 10:26:17, 将该字符串放在map对象中(持久层用的是mybatis或者 ...
- js中yyyymmdd hh:mm:ss字符转换为Date
var dateString="20190102 10:30:35"; var pattern = /(\d{4})(\d{2})(\d{2})/; var formatedDat ...
- js动态获取当前系统时间+js字符串转换为date日期对象
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/ ...
- oracle将unix 时间戳转换为date类型
select to_date('19700101','yyyyMMdd')+numtodsinterval(8*3600,'second')+numtodsinterval(60,'second') ...
- /Date(1410019200000+0800)/如何转换为date对象
<script type="text/javascript">var s = '/Date(1410019200000+0800)/ '; s.replace(/Dat ...
- 字符串类型日期时间转换为Date类型解析转换异常java.text.ParseException: Unparseable date: “2019-09-27T18:31:31+08:00”
错误的写法: SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); //这里的格式也可以是别 ...
- 将Unix时间戳转换为Date、Json属性动态生成反序列化、序列化指定属性
实体类 public class Test { [JsonIgnore] public string GetDate { get { return GetTime.ToString("yyy ...
随机推荐
- springboot idea激活指定profile
多Profile文件 配置文件编写的时,可以是application-{profile}.properties/yml,默认使用application.properties的配置: 激活指定profi ...
- Maven修改默认本地资源库文件夹
默认的Maven地址如下: Linux/Mac:~/.m2(提示:~/为当前用户目录地址) Widnows:C:\Users\{username}\.m2(提示:username为当前用户名) 修改操 ...
- SQLServer 跟踪 扩展事件(Extended Events) 专家
http://blog.csdn.net/kk185800961/article/details/49725903
- mac升级系统自带numpy失败解决方案
sudo pip install -U numpy 后抛出 OSError: [Errno 1] Operation not permitted: '/tmp/pip-o2xinZ-uninstall ...
- Unable to connect to the MKS : Failed to connect to server XXXXXX:903
Issue : 通过 vSphere 连接VM控制台的时候, 报错 Unable to connect to the MKS : Failed to connect to server X ...
- talkingdata比赛分析
1.kaggle数据分析经验: https://medium.com/unstructured/how-feature-engineering-can-help-you-do-well-in-a-ka ...
- utuntu16.04安装caffe+Matlab2017a+opencv3.1+CUDA8.0+cudnn6.0
上午把tensorflow安装好了,下午和晚上装caffe的确很费劲. 默认CUDA,cuDNN可以用了 caffe官方安装教程 有些安装顺序自己也不清楚,简直就是碰运气 1. 安装之前依赖项 Gen ...
- [Algorithom] Stack Data Structure in JavaScript
A stack is a collection of items that obeys the principle of "last in, first out". Like a ...
- 关于SharePoint 讨论板的一些知识
关于SharePoint 讨论板的一些知识 近期公司项目可能要用到讨论板.需求是这种: 怎样在回复中仅仅让查看登陆者和讨论主题公布者的信息. 比方我公布 ...
- 淘宝HSF 框架使用 总结
@(JAVA开发) 淘宝HSF 框架使用 总结 随着网站访问量增加,仅仅靠增加机器已不能满足系统的要求,于是需要对应用系统进行垂直拆分和水平拆分.在拆分之后,各个被拆分的模块如何通信?如何保证性能?如 ...