Struct TimeZoneFollowingTransitions

pub struct TimeZoneFollowingTransitions<'t> { /* private fields */ }

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, ZonedDateTime};

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

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

Trait Implementations

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

fn clone(&self) -> Self

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

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

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

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

type Item = TimeZoneTransition<'t>;
fn next(&mut self) -> Option<TimeZoneTransition<'t>>

Auto Trait Implementations

impl<'t> Freeze for TimeZoneFollowingTransitions<'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> UnsafeUnpin for TimeZoneFollowingTransitions<'t>

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

Blanket Implementations

impl<I> IntoIterator for TimeZoneFollowingTransitions<'t> where I: Iterator,

impl<T> Any for TimeZoneFollowingTransitions<'t> where T: 'static + ?Sized,

impl<T> Borrow<T> for TimeZoneFollowingTransitions<'t> where T: ?Sized,

impl<T> BorrowMut<T> for TimeZoneFollowingTransitions<'t> where T: ?Sized,

impl<T> CloneToUninit for TimeZoneFollowingTransitions<'t> where T: Clone,

impl<T> From<T> for TimeZoneFollowingTransitions<'t>

impl<T> ToOwned for TimeZoneFollowingTransitions<'t> where T: Clone,

impl<T, U> Into<U> for TimeZoneFollowingTransitions<'t> where U: From<T>,

impl<T, U> TryFrom<U> for TimeZoneFollowingTransitions<'t> where U: Into<T>,

impl<T, U> TryInto<U> for TimeZoneFollowingTransitions<'t> where U: TryFrom<T>,