# Struct glib::DateTime [−] [src]

    pub struct DateTime(_);

## Methods

### `impl DateTime`
[src]

#### `pub fn new(
tz: &TimeZone,
year: i32,
month: i32,
day: i32,
hour: i32,
minute: i32,
seconds: f64
) -> DateTime`
[src]

#### `pub fn new_from_unix_local(t: i64) -> DateTime`
[src]

#### `pub fn new_from_unix_utc(t: i64) -> DateTime`
[src]

#### `pub fn new_local(
year: i32,
month: i32,
day: i32,
hour: i32,
minute: i32,
seconds: f64
) -> DateTime`
[src]

#### `pub fn new_now(tz: &TimeZone) -> DateTime`
[src]

#### `pub fn new_now_local() -> DateTime`
[src]

#### `pub fn new_now_utc() -> DateTime`
[src]

#### `pub fn new_utc(
year: i32,
month: i32,
day: i32,
hour: i32,
minute: i32,
seconds: f64
) -> DateTime`
[src]

#### `pub fn add(&self, timespan: TimeSpan) -> Option<DateTime>`
[src]

#### `pub fn add_days(&self, days: i32) -> Option<DateTime>`
[src]

#### `pub fn add_full(
&self,
years: i32,
months: i32,
days: i32,
hours: i32,
minutes: i32,
seconds: f64
) -> Option<DateTime>`
[src]

#### `pub fn add_hours(&self, hours: i32) -> Option<DateTime>`
[src]

#### `pub fn add_minutes(&self, minutes: i32) -> Option<DateTime>`
[src]

#### `pub fn add_months(&self, months: i32) -> Option<DateTime>`
[src]

#### `pub fn add_seconds(&self, seconds: f64) -> Option<DateTime>`
[src]

#### `pub fn add_weeks(&self, weeks: i32) -> Option<DateTime>`
[src]

#### `pub fn add_years(&self, years: i32) -> Option<DateTime>`
[src]

#### `pub fn difference(&self, begin: &DateTime) -> TimeSpan`
[src]

#### `pub fn format(&self, format: &str) -> Option<String>`
[src]

#### `pub fn get_day_of_month(&self) -> i32`
[src]

#### `pub fn get_day_of_week(&self) -> i32`
[src]

#### `pub fn get_day_of_year(&self) -> i32`
[src]

#### `pub fn get_hour(&self) -> i32`
[src]

#### `pub fn get_microsecond(&self) -> i32`
[src]

#### `pub fn get_minute(&self) -> i32`
[src]

#### `pub fn get_month(&self) -> i32`
[src]

#### `pub fn get_second(&self) -> i32`
[src]

#### `pub fn get_seconds(&self) -> f64`
[src]

#### `pub fn get_timezone_abbreviation(&self) -> Option<String>`
[src]

#### `pub fn get_utc_offset(&self) -> TimeSpan`
[src]

#### `pub fn get_week_numbering_year(&self) -> i32`
[src]

#### `pub fn get_week_of_year(&self) -> i32`
[src]

#### `pub fn get_year(&self) -> i32`
[src]

#### `pub fn get_ymd(&self) -> (i32, i32, i32)`
[src]

#### `pub fn is_daylight_savings(&self) -> bool`
[src]

#### `pub fn to_local(&self) -> Option<DateTime>`
[src]

#### `pub fn to_timezone(&self, tz: &TimeZone) -> Option<DateTime>`
[src]

#### `pub fn to_unix(&self) -> i64`
[src]

#### `pub fn to_utc(&self) -> Option<DateTime>`
[src]

### `impl DateTime`
[src]

#### `pub fn compare(&self, other: &Self) -> i32`
[src]

#### `pub fn equal(&self, other: &Self) -> bool`
[src]

## Trait Implementations

### `impl Clone for DateTime`
[src]

#### `fn clone(&self) -> DateTime`
[src]

Returns a copy of the value. Read more

#### `fn clone_from(&mut self, source: &Self)`
1.0.0
[src]

Performs copy-assignment from `source`. Read more

### `impl StaticType for DateTime`
[src]

#### `fn static_type() -> Type`
[src]

Returns the type identifier of `Self`.

### `impl PartialOrd for DateTime`
[src]

#### `fn partial_cmp(&self, other: &Self) -> Option<Ordering>`
[src]

This method returns an ordering between `self` and `other` values if one exists. Read more

#### `fn lt(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests less than (for `self` and `other`) and is used by the `<` operator. Read more

#### `fn le(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests less than or equal to (for `self` and `other`) and is used by the `<=` operator. Read more

#### `fn gt(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests greater than (for `self` and `other`) and is used by the `>` operator. Read more

#### `fn ge(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests greater than or equal to (for `self` and `other`) and is used by the `>=` operator. Read more

### `impl Ord for DateTime`
[src]

#### `fn cmp(&self, other: &Self) -> Ordering`
[src]

This method returns an `Ordering` between `self` and `other`. Read more

#### `fn max(self, other: Self) -> Self`
1.21.0
[src]

Compares and returns the maximum of two values. Read more

#### `fn min(self, other: Self) -> Self`
1.21.0
[src]

Compares and returns the minimum of two values. Read more

### `impl PartialEq for DateTime`
[src]

#### `fn eq(&self, other: &Self) -> bool`
[src]

This method tests for `self` and `other` values to be equal, and is used by `==`. Read more

#### `fn ne(&self, other: &Rhs) -> bool`
1.0.0
[src]

This method tests for `!=`.

### `impl Eq for DateTime`
[src]

# Help

## Keyboard Shortcuts

?
  Show this help dialog
S
  Focus the search field
↑
  Move up in search results
↓
  Move down in search results
↹
  Switch tab
⏎
  Go to active search result
+ / -
  Collapse/expand all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g. `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g. `vec -> usize` or `* -> vec`)