当前位置: 首页 > news >正文

做网站要收订金吗深圳百度

做网站要收订金吗,深圳百度,贵阳企业网站制作,四川省查询建设人员注册证书网站如何把String/Date转成LocalDateTime参考String、Date与LocalDate、LocalTime、LocalDateTime之间互转 String、Date、LocalDateTime、Calendar与时间戳之间互相转化参考String、Date、LocalDateTime、Calendar与时间戳之间互相转化 比较方法介绍 isBefore(ChronoLocalDateT…

如何把String/Date转成LocalDateTime参考String、Date与LocalDate、LocalTime、LocalDateTime之间互转

String、Date、LocalDateTime、Calendar与时间戳之间互相转化参考String、Date、LocalDateTime、Calendar与时间戳之间互相转化

比较方法介绍

isBefore(ChronoLocalDateTime<?> other):是否在other时间之前

isAfter(ChronoLocalDateTime<?> other):是否在other时间之后

isEqual(ChronoLocalDateTime<?> other):是否与other时间相等

toLocalDate().isLeapYear()

时间之间计算

方法1:采用Duration

Duration between(Temporal startInclusive, Temporal endExclusive):创建对象
toDays():endInclusive-startExclusive的天数 可正可负可为零
toHours():endInclusive-startExclusive的小时数 可正可负可为零
toMinutes(): endInclusive-startExclusive的分钟数 可正可负可为零
toMillis(): endInclusive-startExclusive的毫秒数 可正可负可为零
toNanos(): endInclusive-startExclusive的纳秒数 可正可负可为零

方法2:采用Period
Period between(LocalDate startDateInclusive, LocalDate endDateExclusive):创建对象
getYears():endDateExclusive-startDateInclusive的年 可正可负可为零
getMonths(): endDateExclusive-startDateInclusive的月 可正可负可为零
getDays() :endDateExclusive-startDateInclusive的日 可正可负可为零

具体使用:

import java.time.*;
import java.time.format.DateTimeFormatter;
import java.util.Date;/*** 测试LocalDate* @author leishen*/
public class LocalDateTest {/*** LOCAL_DATE_TIME的时间格式*/private static final DateTimeFormatter LOCAL_DATE_TIME=DateTimeFormatter.ofPattern("yyyy-MM-dd HH:mm:ss ms ns");public static void main(String[] args){//系统默认时区ZoneId zoneId = ZoneId.systemDefault();//Date-->ZonedDateTimeZonedDateTime zonedDateTime = new Date().toInstant().atZone(zoneId);//当前时间LocalDateTime now = zonedDateTime.toLocalDateTime();LocalDateTime localDateTime = LocalDateTime.of(2024, 2, 9, 14, 59,59);//isBefore(ChronoLocalDateTime<?> other):是否在other时间之前System.out.println("local.isBefore(now) = " + localDateTime.isBefore(now));//isAfter(ChronoLocalDateTime<?> other):是否在other时间之后System.out.println("local.isAfter(now) = " + localDateTime.isAfter(now));//isEqual(ChronoLocalDateTime<?> other):是否与other时间相等System.out.println("local.isEqual(now) = " + localDateTime.isEqual(now));//判断当前时间是否是闰年System.out.println("local.toLocalDate().isLeapYear() = " + localDateTime.toLocalDate().isLeapYear());System.out.println();//between(Temporal startInclusive, Temporal endExclusive)Duration duration = Duration.between(now,localDateTime);//toDays():endInclusive-startExclusive的天数 可正可负可为零System.out.println("duration.toDays() = " + duration.toDays());//toHours():endInclusive-startExclusive的小时数 可正可负可为零System.out.println("duration.toHours() = " + duration.toHours());//toMinutes(): endInclusive-startExclusive的分钟数 可正可负可为零System.out.println("duration.toMinutes() = " + duration.toMinutes());//toMillis(): endInclusive-startExclusive的毫秒数 可正可负可为零System.out.println("duration.toMillis() = " + duration.toMillis());//toNanos(): endInclusive-startExclusive的纳秒数 可正可负可为零System.out.println("duration.toNanos() = " + duration.toNanos());//between(LocalDate startDateInclusive, LocalDate endDateExclusive)Period period = Period.between(now.toLocalDate(), localDateTime.toLocalDate());//getYears() endDateExclusive-startDateInclusive的年 可正可负可为零System.out.println("period.getYears() = " + period.getYears());//getMonths() endDateExclusive-startDateInclusive的月 可正可负可为零System.out.println("period.getMonths() = " + period.getMonths());//getDays() endDateExclusive-startDateInclusive的日 可正可负可为零System.out.println("period.getDays() = " + period.getDays());}}
http://www.hkea.cn/news/283975/

相关文章:

  • 网站模板论坛今日重大军事新闻
  • 昆山自适应网站建设电商平台的营销方式
  • 盘龙区网站建设外包高级搜索引擎技巧
  • 什么做的网站吗58百度搜索引擎
  • wordpress 企业站开发口碑营销的概念
  • 广州免费核酸检测点东莞seo项目优化方法
  • 学风建设网站版块设计个人网站
  • 网站底部连接怎么做福州seo推广
  • 生猪价格今日猪价行情关键词优化是什么工作
  • 网站建设公司下载搜索引擎查询
  • 韩国吃秀在哪个网站做直播企业宣传
  • 江西网站建设成都百度
  • 糯米团网站怎么做微信软文范例100字
  • 如何在社交网站上做视频推广seo营销的概念
  • 大连做网站仟亿科技最新域名查询
  • 网站开发实施计划与安排宁波网络推广方式
  • 企业网站建设公司注意哪些问题软件开发外包公司
  • abc网站建设怎么样yandex引擎搜索入口
  • wordpress屏蔽f12广州seo网络优化公司
  • 南宁网站建设推广服务云服务器免费
  • 大数据营销是什么seo站长
  • 建设政府网站的公司乐山网站seo
  • 仿站容易还是建站容易专业做灰色关键词排名
  • 做网站背景音乐管理课程培训
  • 网站建设可以自学吗品牌软文范文
  • 网站风格对比哪里有学计算机培训班
  • 做mla的网站网站优化哪家好
  • 网站注册的账号怎么注销线上营销活动有哪些
  • 国内做进口的电商网站网站推广软件哪个好
  • 谁有做那事的网站百度投诉中心入口