Java8新特性 第13课-localDateTime类
来源:互联网 发布:海贼王里的熊猫人 知乎 编辑:程序博客网 时间:2024/09/21 09:01
LocalDateTime类用于表示日期和时间。
LocalDateTime类的常用方法:
1、LocalDateTime.now():获取系统当前时间。
2、LocalDateTime.of(intyear,intmonth,intdayOfMonth
inthour,intminute,int second)
按指定日期和时间创建LocalDateTime对象。
3、getYear():返回日期中的年份。
4、getMonth():返回日期中的月份。
5、getDayOfMonth():返回月份中的日。
6、getHour():返回小时。
7、getMinute():返回分钟。
8、getSecond():返回秒。
【案例】用LocalDateTime获取当前日期和时间
0 0
- Java8新特性 第13课-localDateTime类
- Java8新特性 第13课-localTime类
- Java8新特性 第12课-localDate类
- Java8新特性 第15课- DateTimeFormatter类
- Java8新特性 第16课- ZonedDateTime类
- Java8中的LocalDateTime工具类
- Java8新特性 第10课-过滤器案例
- Java8新特性 第11课-DoubleStream接口
- Java8-LocalDateTime
- Java8新特性 - Optional类
- Java8新特性 - Optional类
- java8新特性---Optional类
- java8 LocalDate LocalDateTime等时间类介绍
- java8 新时间API用法实例(LocalDate、LocalTime、LocalDateTime)
- Java8 新特性之 Optional 类
- java8 新特性
- java8新特性 ---译
- Java8新特性教程
- POJ 题目2955 Brackets(区间dp)
- canada goose coat-086811
- 信息学竞赛刷题建议历程
- Java8新特性 第13课-localTime类
- Vs2012在Linux开发中的应用(13): 添加对x86 Linux的支持
- Java8新特性 第13课-localDateTime类
- Dalvik虚拟机为新创建对象分配内存的过程分析
- Java转义
- C++ inline 函数
- Java8新特性 第15课- DateTimeFormatter类
- 关于我,我是一个会打篮球,喜欢动漫,对电脑技术有兴趣的普通大学生
- Android 4.3系统拍照后无法剪裁问题
- Java8新特性 第16课- ZonedDateTime类
- HDOJ5115 Dire Wolf(区间dp) ——2014北京现场赛D题