概述

自己在使用Java日志格式的时候,发现不好定义。所以本篇文章的主要目的是收集一些常用的日志格式,解说每个字段代表的意思以及扩充部分Java常用的时间类。

名词解释

时刻:时刻是时间上的某个瞬间,,或是时间轴上的某个点。时刻可以作为时间间隔的起点和终点

时代:一个时代是用作测量其他时刻的起源的瞬间。 时代是在1970-01-01T00:00:00Z。时代之后的时刻具有正值,而时代之前的时刻具有负值。

java 8类说明

java.time 包含的api都是基于iso 8601的。

1.java.time.LocalDate:LocalDate是一个不可变的类,它表示默认格式(yyyy-MM-dd)的日期

2.java.time.LocalTime:LocalTime是一个不可变的类,它的实例代表一个符合人类可读格式的时间,默认格式是hh:mm:ss.zzz

ISO字符替代说明

[Y] represents a digit used in the time element “year”;

[M] represents a digit used in the time element “month”;

[D] represents a digit used in the time element “day”;

[w] represents a digit used in the time element “week”;

[h] represents a digit used in the time element “hour”;

[m] represents a digit used in the time element “minute”;

[s] represents a digit used in the time element “second”;

[n] represents a digit from a positive integer or zero;

[±] represents a plus sign [+] if in combination with the following element a positive value or zero needs to be represented (in this case, unless explicitly stated otherwise, the plus sign shall not be omitted), or a minus sign [−] if in combination with the following element a negative value needs to be represented.

In addition the following convention applies:

[_] When any of the characters representing a digit is underlined, it represents zero or more digits

in the corresponding date and time representation.

Other characters in the date and time format representations are copied in the date and time

representations.

时间格式收录

序号

格式

示例

1

yyyy/MM/dd HH:mm:ss Z

2018/05/16 15:09:02 +0800

以上就是本文的全部内容,希望对大家的学习有所帮助,也希望大家多多支持脚本之家。

java time 格式_java时间格式的简单整理相关推荐

  1. java 设置日期的格式_java时间格式大全

    java.util.*; import java.text.*; import java.util.Calendar; public class VeDate { /** * 获取现在时间 * * @ ...

  2. java格式_java时间格式转换大全

    Java时间格式转换大全 import java.text.*; import java.util.Calendar; public class VeDate { /** * 获取现在时间 * * @ ...

  3. java定义日期格式_Java时间格式定义详解

    概述 自己在使用Java日志格式的时候,发现不好定义.所以本篇文章的主要目的是收集一些常用的日志格式,解说每个字段代表的意思以及扩充部分Java常用的时间类. 重要参考文档 文章进度2018515 完 ...

  4. java获取24小时制时间格式_java 日期格式时间24小时制

    按指定格式获取时间 import java.util.*; import java.text.*; public class TestDate { public static void main(St ...

  5. java定义时间格式大全_Java时间格式转换大全

    package com.date; import java.text.DateFormat; import java.text.ParseException; import java.text.Par ...

  6. java转日期_Java时间日期格式转换

    import java.util.*;import java.text.*;importjava.util.Calendar;public classVeDate {/*** 获取现在时间 * *@r ...

  7. java时间格式大全_java时间格式大全

    java.util.*; import java.text.*; import java.util.Calendar; public class VeDate { /** * 获取现在时间 * * @ ...

  8. 字符串格式化成时间格式_JAVA | 常用的日期/时间格式化方式

    引言   我们在开发过程中,在数据库中经常会看到beginTime.updateTime和endTime这些字段,这些可能是为了记录业务操作的某个时间.日期等信息.特此,总结一些在代码中常用的日期.时 ...

  9. java日期转换_java日期格式转换

    突然忘记了时间格式怎么转换,特此做个记录 Java时间格式转换大全 import java.text.*; import java.util.Calendar; public class VeDate ...

最新文章

  1. resultmap为list_MyBatis源码:原来 resultMap 解析完是这样
  2. 交换机无法ping通之谜
  3. mysql数据库rpm包_MySQL 8.0官方数据库RPMZIP for Linux/windows x64安装包程序下载
  4. 安卓服务Service详解
  5. 008 selenium html报告
  6. nas php.ini,php.ini 配置文件常用详解
  7. Httpd 使用ip可以访问,localhost和127.0.0.1不能访问
  8. 根据用户id查询菜单列表(菜单权限问题)
  9. IDEA中配置Python环境并运行
  10. linux怎么随机按行打散文件,linux shell 将文件按照行数以及顺序拆分成多个文件...
  11. EF之通过不同条件查找去重复
  12. vue中有汉字和数字。怎么截取汉字保留数字_Excel提取中文,数字和字母,一分钟搞定!...
  13. java将pdf转换为jpg图片格式
  14. 如何获取目标期刊的参考文献格式模板?
  15. 比较常见的操作系统有哪些
  16. pytorch深度学习出错整理(一)
  17. 【读书笔记】《云计算关键领域安全指南V4.0》(一)
  18. NYOJ_170聪明的kk
  19. 0 嵌入式-ARM简介
  20. 比越南妹划算 1元团购美女

热门文章

  1. 从日常数据开始培养运营的数据思维
  2. SQLSERVER 事务日志 LSN 到底是什么?
  3. Jquery消息提示插件toastr
  4. 数商云:工业4.0时代,我国传统机械制造业如何提高核心竞争力
  5. 微信公众号代运营的的技巧有哪些(7)
  6. 1234. 倍数问题 dp 数组 背包问题 状态压缩
  7. 数据库的锁机制(悲观锁/乐观锁)
  8. 自然语言处理之情感分析与观点挖掘
  9. 联想笔记本屏幕突然变得很暗亮度无法调节解决方法
  10. 天猫店群是什么?有什么内幕吗?值得投资去做天猫店群吗?