org.threeten.bp.zone.ZoneOffsetTransitionRule.getDayOfWeek()方法的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(94)

本文整理了Java中org.threeten.bp.zone.ZoneOffsetTransitionRule.getDayOfWeek()方法的一些代码示例,展示了ZoneOffsetTransitionRule.getDayOfWeek()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneOffsetTransitionRule.getDayOfWeek()方法的具体详情如下:
包路径:org.threeten.bp.zone.ZoneOffsetTransitionRule
类名称:ZoneOffsetTransitionRule
方法名:getDayOfWeek

ZoneOffsetTransitionRule.getDayOfWeek介绍

[英]Gets the day-of-week of the transition.

If the rule defines an exact date then this returns null.

If the rule defines a week where the cutover might occur, then this method returns the day-of-week that the month-day will be adjusted to. If the day is positive then the adjustment is later. If the day is negative then the adjustment is earlier.
[中]获取转换的星期几。
如果规则定义了一个确切的日期,则返回null。
如果规则定义了可能发生切换的一周,则此方法返回将调整月份的星期几。如果当天为正值,则调整将推迟。如果当天为负值,则调整时间提前。

代码示例

代码示例来源:origin: stackoverflow.com

rule.createTransition(thisYear).getDateTimeBefore().get(
  weekOfMonth),
rule.getDayOfWeek().getValue() % 7,
rule.getLocalTime());

代码示例来源:origin: net.oneandone.ical4j/ical4j

DayOfWeek transitionRuleDayOfWeek = transitionRule.getDayOfWeek();
LocalDateTime ldt = LocalDateTime.now(zoneId)
                .with(TemporalAdjusters.firstInMonth(transitionRuleDayOfWeek))
  observance.getProperties().add(new DtStart(String.format(DATE_TIME_TPL, startDate.withMonth(transitionRule.getMonth().getValue())
                                                      .withDayOfMonth(transitionRule.getDayOfMonthIndicator())
                                                      .with(transitionRule.getDayOfWeek()))));

相关文章