当前位置:网站首页>时间格式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
边栏推荐
- PPOCR 检测器配置文件参数详解
- Go编译原理系列6(类型检查)
- RT-Thread记录(一、RT-Thread 版本、RT-Thread Studio开发环境 及 配合CubeMX开发快速上手)
- flutter 服务器返回数据判断是否为空
- 5G NR 系统消息
- 字节一面:TCP 和 UDP 可以使用同一个端口吗?
- 上位机开发C#语言:模拟STC串口助手接收单片机发送数据
- Use KUSTO query statement (KQL) to query LOG on Azure Data Explorer Database
- FPGA:基础入门LED灯闪烁
- 自定义过滤器和拦截器实现ThreadLocal线程封闭
猜你喜欢
RT - Thread record (a, RT, RT Thread version - Thread Studio development environment and cooperate CubeMX quick-and-dirty)
HDD杭州站•ArkUI让开发更灵活
Create a Dapp, why choose Polkadot?
一张图看懂 SQL 的各种 join 用法!
脱光衣服待着就能减肥,当真有这好事?
【OpenCV】-仿射变换
PG优化篇--执行计划相关项
How to choose coins and determine the corresponding strategy research
教你本地编译运行一个IDEA插件,在IDEA里聊天、下棋、斗地主!
Microcontroller: temperature control DS18B20
随机推荐
第四章:redis 数组结构的set和一些通用命令「建议收藏」
Chapter 5: Activiti process shunting judgment, judging to go to different task nodes
Ali's new launch: Microservices Assault Manual, all operations are written out in PDF
linux下oracle常见操作以及日常积累知识点(函数、定时任务)
The fuse: OAuth 2.0 four authorized login methods must read
Chapter 4: activiti RuntimeService settings get and get process variables, and the difference from taskService, set process variables when starting and completing tasks [easy to understand]
苹果Meta都在冲的Pancake技术,中国VR团队YVR竟抢先交出产品答卷
What are the standards for electrical engineering
Still looking for a network backup resources?Hurry up to collect the following network backup resource search artifact it is worth collecting!
The host computer develops C# language: simulates the STC serial port assistant to receive the data sent by the microcontroller
PG优化篇--执行计划相关项
学生信息管理系统(第一次.....)
PCB布局必知必会:教你正确地布设运算放大器的电路板
GPU-CUDA-图形渲染分析
SkiaSharp 之 WPF 自绘 投篮小游戏(案例版)
FPGA:基础入门LED灯闪烁
化繁为简!阿里新产亿级流量系统设计核心原理高级笔记(终极版)
一张图看懂 SQL 的各种 join 用法!
[Android]如何使用RecycleView in Kotlin project
记2022年七夕感慨