Struct TimeZoneFollowingTransitions

struct TimeZoneFollowingTransitions<'t> { ... }

An iterator over time zone transitions going forward in time.

This iterator is created by TimeZone::following.

Example: show the 5 next time zone transitions

This shows how to find the 5 following time zone transitions (from a particular datetime) for a particular time zone:

use jiff::{tz::offset, Zoned};

let now: Zoned = "2024-12-31 18:25-05[US/Eastern]".parse()?;
let transitions = now
    .time_zone()
    .following(now.timestamp())
    .take(5)
    .map(|t| (
        t.timestamp().to_zoned(now.time_zone().clone()),
        t.offset(),
        t.abbreviation().to_string(),
    ))
    .collect::<Vec<_>>();
assert_eq!(transitions, vec![
    ("2025-03-09 03:00-04[US/Eastern]".parse()?, offset(-4), "EDT".to_string()),
    ("2025-11-02 01:00-05[US/Eastern]".parse()?, offset(-5), "EST".to_string()),
    ("2026-03-08 03:00-04[US/Eastern]".parse()?, offset(-4), "EDT".to_string()),
    ("2026-11-01 01:00-05[US/Eastern]".parse()?, offset(-5), "EST".to_string()),
    ("2027-03-14 03:00-04[US/Eastern]".parse()?, offset(-4), "EDT".to_string()),
]);

# Ok::<(), Box<dyn std::error::Error>>(())

Implementations

impl<'t> Clone for TimeZoneFollowingTransitions<'t>

fn clone(self: &Self) -> TimeZoneFollowingTransitions<'t>

impl<'t> Debug for TimeZoneFollowingTransitions<'t>

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result

impl<'t> Freeze for TimeZoneFollowingTransitions<'t>

impl<'t> FusedIterator for TimeZoneFollowingTransitions<'t>

impl<'t> Iterator for TimeZoneFollowingTransitions<'t>

fn next(self: &mut Self) -> Option<TimeZoneTransition<'t>>

impl<'t> RefUnwindSafe for TimeZoneFollowingTransitions<'t>

impl<'t> Send for TimeZoneFollowingTransitions<'t>

impl<'t> Sync for TimeZoneFollowingTransitions<'t>

impl<'t> Unpin for TimeZoneFollowingTransitions<'t>

impl<'t> UnwindSafe for TimeZoneFollowingTransitions<'t>

impl<I> IntoIterator for TimeZoneFollowingTransitions<'t>

fn into_iter(self: Self) -> I

impl<T> Any for TimeZoneFollowingTransitions<'t>

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for TimeZoneFollowingTransitions<'t>

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for TimeZoneFollowingTransitions<'t>

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for TimeZoneFollowingTransitions<'t>

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for TimeZoneFollowingTransitions<'t>

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for TimeZoneFollowingTransitions<'t>

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for TimeZoneFollowingTransitions<'t>

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for TimeZoneFollowingTransitions<'t>

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for TimeZoneFollowingTransitions<'t>

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>