Struct chrono::offset::Local[][src]

pub struct Local;

The local timescale. This is implemented via the standard time crate.

Using the TimeZone methods on the Local struct is the preferred way to construct DateTime<Local> instances.


use chrono::{Local, DateTime, TimeZone};

let dt: DateTime<Local> = Local::now();
let dt: DateTime<Local> = Local.timestamp(0, 0);


impl Local[src]

pub fn today() -> Date<Local>[src]

Returns a Date which corresponds to the current date.

pub fn now() -> DateTime<Local>[src]

Returns a DateTime which corresponds to the current date.

Trait Implementations

impl Clone for Local[src]

impl Copy for Local[src]

impl Debug for Local[src]

impl TimeZone for Local[src]

type Offset = FixedOffset

An associated offset type. This type is used to store the actual offset in date and time types. The original TimeZone value can be recovered via TimeZone::from_offset. Read more

Auto Trait Implementations

impl RefUnwindSafe for Local[src]

impl Send for Local[src]

impl Sync for Local[src]

impl Unpin for Local[src]

impl UnwindSafe for Local[src]

Blanket Implementations

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

impl<T> Borrow<T> for T where
    T: ?Sized

impl<T> BorrowMut<T> for T where
    T: ?Sized

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.