当前位置:网站首页>时间格式2020-01-13T16:00:00.000Z中的T和Z分别表示什么,如何处理
时间格式2020-01-13T16:00:00.000Z中的T和Z分别表示什么,如何处理
2022-08-05 10:54:00 【不求人0】
转载
T表示分隔符,Z表示的是UTC。
UTC:世界标准时间,在标准时间上加上8小时,即东八区时间,也就是北京时间。
举例
北京时间:2020-01-14 00:00:00对应的国际标准时间格式为:2020-01-13T16:00:00.000Z
String dateTime = "2020-01-13T16:00:00.000Z";
dateTime = dateTime.replace("Z", " UTC");
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS Z");
SimpleDateFormat defaultFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
try {
Date time = format.parse(dateTime);
String result = defaultFormat.format(time);
System.out.println(result);
} catch (Exception e) {
e.printStackTrace();
}
// 输出结果:2020-01-14 00:00:00
边栏推荐
猜你喜欢

今天告诉你界面控件DevExpress WinForms为何弃用经典视觉样式

This notebook of concurrent programming knowledge points strongly recommended by Ali will be a breakthrough for you to get an offer from a big factory

《分布式云最佳实践》分论坛,8 月 11 日深圳见

【加密解密】明文加密解密-已实现【已应用】

如何选币与确定对应策略研究

Scaling-law和模型结构的关系:不是所有的结构放大后都能保持最好性能

Login function and logout function (St. Regis Takeaway)

MySQL 中 auto_increment 自动插入主键值

深入理解 Istio 流量管理的超时时间设置

数据可视化(一)
随机推荐
Chapter 5: Activiti process shunting judgment, judging to go to different task nodes
化繁为简!阿里新产亿级流量系统设计核心原理高级笔记(终极版)
poj2935 Basic Wall Maze (2016xynu暑期集训检测 -----D题)
Go编译原理系列6(类型检查)
Google启动通用图像嵌入挑战赛
微信小程序标题栏封装
【MySQL基础】-【数据处理之增删改】
Microcontroller: temperature control DS18B20
第五章:redis持久化,包括rdb和aof两种方式[通俗易懂]
工程设备在线监测管理系统自动预警功能
5G NR 系统消息
R语言ggplot2可视化:可视化密度图(Density plot)、可视化多个分组的密度图、数据点分布在箱图中间、添加主标题、副标题、题注信息
2022技能大赛训练题:交换机snmp配置
学生信息管理系统(第一次.....)
字节一面:TCP 和 UDP 可以使用同一个端口吗?
第四章:activiti RuntimeService设置获和取流程变量,及与taskService的区别,开始和完成任务时设置流程变量[通俗易懂]
Common operations of oracle under linux and daily accumulation of knowledge points (functions, timed tasks)
poj2287 Tian Ji -- The Horse Racing(2016xynu暑期集训检测 -----C题)
PPOCR 检测器配置文件参数详解
FPGA:开发环境Vivado的使用