blob: 69af2c2f8b04b63c1aba8cb647a7d3cb7c77ca31 [file] [log] [blame]
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="generator" content="rustdoc"><meta name="description" content="The time zone with fixed offset, from UTC-23:59:59 to UTC+23:59:59."><meta name="keywords" content="rust, rustlang, rust-lang, FixedOffset"><title>FixedOffset in chrono::offset - Rust</title><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Regular.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../FiraSans-Medium.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Regular.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceSerif4-Bold.ttf.woff2"><link rel="preload" as="font" type="font/woff2" crossorigin href="../../SourceCodePro-Semibold.ttf.woff2"><link rel="stylesheet" href="../../normalize.css"><link rel="stylesheet" href="../../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" href="../../ayu.css" disabled><link rel="stylesheet" href="../../dark.css" disabled><link rel="stylesheet" href="../../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../../storage.js"></script><script defer src="sidebar-items.js"></script><script defer src="../../main.js"></script><noscript><link rel="stylesheet" href="../../noscript.css"></noscript><link rel="alternate icon" type="image/png" href="../../favicon-16x16.png"><link rel="alternate icon" type="image/png" href="../../favicon-32x32.png"><link rel="icon" type="image/svg+xml" href="../../favicon.svg"></head><body class="rustdoc struct"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="mobile-topbar"><button class="sidebar-menu-toggle">&#9776;</button><a class="sidebar-logo" href="../../chrono/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2></h2></nav><nav class="sidebar"><a class="sidebar-logo" href="../../chrono/index.html"><div class="logo-container"><img class="rust-logo" src="../../rust-logo.svg" alt="logo"></div></a><h2 class="location"><a href="#">FixedOffset</a></h2><div class="sidebar-elems"><section><h3><a href="#implementations">Methods</a></h3><ul class="block"><li><a href="#method.east">east</a></li><li><a href="#method.east_opt">east_opt</a></li><li><a href="#method.local_minus_utc">local_minus_utc</a></li><li><a href="#method.utc_minus_local">utc_minus_local</a></li><li><a href="#method.west">west</a></li><li><a href="#method.west_opt">west_opt</a></li></ul><h3><a href="#trait-implementations">Trait Implementations</a></h3><ul class="block"><li><a href="#impl-Add%3CFixedOffset%3E-for-DateTime%3CTz%3E">Add&lt;FixedOffset&gt;</a></li><li><a href="#impl-Add%3CFixedOffset%3E-for-NaiveDateTime">Add&lt;FixedOffset&gt;</a></li><li><a href="#impl-Add%3CFixedOffset%3E-for-NaiveTime">Add&lt;FixedOffset&gt;</a></li><li><a href="#impl-Clone-for-FixedOffset">Clone</a></li><li><a href="#impl-Copy-for-FixedOffset">Copy</a></li><li><a href="#impl-Debug-for-FixedOffset">Debug</a></li><li><a href="#impl-Display-for-FixedOffset">Display</a></li><li><a href="#impl-Eq-for-FixedOffset">Eq</a></li><li><a href="#impl-Hash-for-FixedOffset">Hash</a></li><li><a href="#impl-Offset-for-FixedOffset">Offset</a></li><li><a href="#impl-PartialEq%3CFixedOffset%3E-for-FixedOffset">PartialEq&lt;FixedOffset&gt;</a></li><li><a href="#impl-StructuralEq-for-FixedOffset">StructuralEq</a></li><li><a href="#impl-StructuralPartialEq-for-FixedOffset">StructuralPartialEq</a></li><li><a href="#impl-Sub%3CFixedOffset%3E-for-DateTime%3CTz%3E">Sub&lt;FixedOffset&gt;</a></li><li><a href="#impl-Sub%3CFixedOffset%3E-for-NaiveDateTime">Sub&lt;FixedOffset&gt;</a></li><li><a href="#impl-Sub%3CFixedOffset%3E-for-NaiveTime">Sub&lt;FixedOffset&gt;</a></li><li><a href="#impl-TimeZone-for-FixedOffset">TimeZone</a></li></ul><h3><a href="#synthetic-implementations">Auto Trait Implementations</a></h3><ul class="block"><li><a href="#impl-RefUnwindSafe-for-FixedOffset">RefUnwindSafe</a></li><li><a href="#impl-Send-for-FixedOffset">Send</a></li><li><a href="#impl-Sync-for-FixedOffset">Sync</a></li><li><a href="#impl-Unpin-for-FixedOffset">Unpin</a></li><li><a href="#impl-UnwindSafe-for-FixedOffset">UnwindSafe</a></li></ul><h3><a href="#blanket-implementations">Blanket Implementations</a></h3><ul class="block"><li><a href="#impl-Any-for-FixedOffset">Any</a></li><li><a href="#impl-Borrow%3CT%3E-for-FixedOffset">Borrow&lt;T&gt;</a></li><li><a href="#impl-BorrowMut%3CT%3E-for-FixedOffset">BorrowMut&lt;T&gt;</a></li><li><a href="#impl-From%3CT%3E-for-FixedOffset">From&lt;T&gt;</a></li><li><a href="#impl-Into%3CU%3E-for-FixedOffset">Into&lt;U&gt;</a></li><li><a href="#impl-ToOwned-for-FixedOffset">ToOwned</a></li><li><a href="#impl-ToString-for-FixedOffset">ToString</a></li><li><a href="#impl-TryFrom%3CU%3E-for-FixedOffset">TryFrom&lt;U&gt;</a></li><li><a href="#impl-TryInto%3CU%3E-for-FixedOffset">TryInto&lt;U&gt;</a></li></ul></section><h2><a href="index.html">In chrono::offset</a></h2></div></nav><main><div class="width-limiter"><nav class="sub"><form class="search-form"><div class="search-container"><span></span><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press ‘S’ to search, ‘?’ for more options…" type="search"><div id="help-button" title="help" tabindex="-1"><a href="../../help.html">?</a></div><div id="settings-menu" tabindex="-1"><a href="../../settings.html" title="settings"><img width="22" height="22" alt="Change settings" src="../../wheel.svg"></a></div></div></form></nav><section id="main-content" class="content"><div class="main-heading"><h1 class="fqn">Struct <a href="../index.html">chrono</a>::<wbr><a href="index.html">offset</a>::<wbr><a class="struct" href="#">FixedOffset</a><button id="copy-path" onclick="copy_path(this)" title="Copy item path to clipboard"><img src="../../clipboard.svg" width="19" height="18" alt="Copy item path"></button></h1><span class="out-of-band"><a class="srclink" href="../../src/chrono/offset/fixed.rs.html#26-28">source</a> · <a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span></div><div class="item-decl"><pre class="rust struct"><code>pub struct FixedOffset { /* private fields */ }</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The time zone with fixed offset, from UTC-23:59:59 to UTC+23:59:59.</p>
<p>Using the <a href="./trait.TimeZone.html"><code>TimeZone</code></a> methods
on a <code>FixedOffset</code> struct is the preferred way to construct
<code>DateTime&lt;FixedOffset&gt;</code> instances. See the <a href="#method.east_opt"><code>east_opt</code></a> and
<a href="#method.west_opt"><code>west_opt</code></a> methods for examples.</p>
</div></details><h2 id="implementations" class="small-section-header">Implementations<a href="#implementations" class="anchor"></a></h2><div id="implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-FixedOffset" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#30-114">source</a><a href="#impl-FixedOffset" class="anchor"></a><h3 class="code-header">impl <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.east" class="method has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#37-39">source</a><h4 class="code-header">pub fn <a href="#method.east" class="fnname">east</a>(secs: i32) -&gt; <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.4.23: use <code>east_opt()</code> instead</span></div></span></summary><div class="docblock"><p>Makes a new <code>FixedOffset</code> for the Eastern Hemisphere with given timezone difference.
The negative <code>secs</code> means the Western Hemisphere.</p>
<p>Panics on the out-of-bound <code>secs</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.east_opt" class="method has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#59-65">source</a><h4 class="code-header">pub const fn <a href="#method.east_opt" class="fnname">east_opt</a>(secs: i32) -&gt; Option&lt;<a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt;</h4></section></summary><div class="docblock"><p>Makes a new <code>FixedOffset</code> for the Eastern Hemisphere with given timezone difference.
The negative <code>secs</code> means the Western Hemisphere.</p>
<p>Returns <code>None</code> on the out-of-bound <code>secs</code>.</p>
<h5 id="example"><a href="#example">Example</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>chrono::{FixedOffset, TimeZone};
<span class="kw">let </span>hour = <span class="number">3600</span>;
<span class="kw">let </span>datetime = FixedOffset::east_opt(<span class="number">5 </span>* hour)
.unwrap()
.with_ymd_and_hms(<span class="number">2016</span>, <span class="number">11</span>, <span class="number">08</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>)
.unwrap();
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>datetime.to_rfc3339(), <span class="string">&quot;2016-11-08T00:00:00+05:00&quot;</span>)</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.west" class="method has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#73-75">source</a><h4 class="code-header">pub fn <a href="#method.west" class="fnname">west</a>(secs: i32) -&gt; <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h4></section><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.4.23: use <code>west_opt()</code> instead</span></div></span></summary><div class="docblock"><p>Makes a new <code>FixedOffset</code> for the Western Hemisphere with given timezone difference.
The negative <code>secs</code> means the Eastern Hemisphere.</p>
<p>Panics on the out-of-bound <code>secs</code>.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.west_opt" class="method has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#95-101">source</a><h4 class="code-header">pub const fn <a href="#method.west_opt" class="fnname">west_opt</a>(secs: i32) -&gt; Option&lt;<a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt;</h4></section></summary><div class="docblock"><p>Makes a new <code>FixedOffset</code> for the Western Hemisphere with given timezone difference.
The negative <code>secs</code> means the Eastern Hemisphere.</p>
<p>Returns <code>None</code> on the out-of-bound <code>secs</code>.</p>
<h5 id="example-1"><a href="#example-1">Example</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use </span>chrono::{FixedOffset, TimeZone};
<span class="kw">let </span>hour = <span class="number">3600</span>;
<span class="kw">let </span>datetime = FixedOffset::west_opt(<span class="number">5 </span>* hour)
.unwrap()
.with_ymd_and_hms(<span class="number">2016</span>, <span class="number">11</span>, <span class="number">08</span>, <span class="number">0</span>, <span class="number">0</span>, <span class="number">0</span>)
.unwrap();
<span class="macro">assert_eq!</span>(<span class="kw-2">&amp;</span>datetime.to_rfc3339(), <span class="string">&quot;2016-11-08T00:00:00-05:00&quot;</span>)</code></pre></div>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.local_minus_utc" class="method has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#105-107">source</a><h4 class="code-header">pub const fn <a href="#method.local_minus_utc" class="fnname">local_minus_utc</a>(&amp;self) -&gt; i32</h4></section></summary><div class="docblock"><p>Returns the number of seconds to add to convert from UTC to the local time.</p>
</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.utc_minus_local" class="method has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#111-113">source</a><h4 class="code-header">pub const fn <a href="#method.utc_minus_local" class="fnname">utc_minus_local</a>(&amp;self) -&gt; i32</h4></section></summary><div class="docblock"><p>Returns the number of seconds to add to convert from the local time to UTC.</p>
</div></details></div></details></div><h2 id="trait-implementations" class="small-section-header">Trait Implementations<a href="#trait-implementations" class="anchor"></a></h2><div id="trait-implementations-list"><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Add%3CFixedOffset%3E-for-DateTime%3CTz%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#227-234">source</a><a href="#impl-Add%3CFixedOffset%3E-for-DateTime%3CTz%3E" class="anchor"></a><h3 class="code-header">impl&lt;Tz:&nbsp;<a class="trait" href="trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>&gt; Add&lt;<a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output-4" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output-4" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Output</a> = <a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</h4></section></summary><div class='docblock'>The resulting type after applying the <code>+</code> operator.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.add-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#231-233">source</a><a href="#method.add-2" class="anchor"></a><h4 class="code-header">fn <a class="fnname">add</a>(self, rhs: <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</h4></section></summary><div class='docblock'>Performs the <code>+</code> operation. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Add%3CFixedOffset%3E-for-NaiveDateTime" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#209-216">source</a><a href="#impl-Add%3CFixedOffset%3E-for-NaiveDateTime" class="anchor"></a><h3 class="code-header">impl Add&lt;<a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output-2" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output-2" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Output</a> = <a class="struct" href="../naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></h4></section></summary><div class='docblock'>The resulting type after applying the <code>+</code> operator.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.add-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#213-215">source</a><a href="#method.add-1" class="anchor"></a><h4 class="code-header">fn <a class="fnname">add</a>(self, rhs: <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></h4></section></summary><div class='docblock'>Performs the <code>+</code> operation. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Add%3CFixedOffset%3E-for-NaiveTime" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#191-198">source</a><a href="#impl-Add%3CFixedOffset%3E-for-NaiveTime" class="anchor"></a><h3 class="code-header">impl Add&lt;<a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Output</a> = <a class="struct" href="../naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></h4></section></summary><div class='docblock'>The resulting type after applying the <code>+</code> operator.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.add" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#195-197">source</a><a href="#method.add" class="anchor"></a><h4 class="code-header">fn <a class="fnname">add</a>(self, rhs: <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></h4></section></summary><div class='docblock'>Performs the <code>+</code> operation. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Clone-for-FixedOffset" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#24">source</a><a href="#impl-Clone-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl Clone for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#24">source</a><a href="#method.clone" class="anchor"></a><h4 class="code-header">fn <a class="fnname">clone</a>(&amp;self) -&gt; <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h4></section></summary><div class='docblock'>Returns a copy of the value. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_from" class="method trait-impl has-srclink"><span class="since rightside" title="Stable since Rust version 1.0.0">1.0.0</span><a href="#method.clone_from" class="anchor"></a><h4 class="code-header">const fn <a class="fnname">clone_from</a>(&amp;mut self, source: &amp;Self)</h4></section></summary><div class='docblock'>Performs copy-assignment from <code>source</code>. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Debug-for-FixedOffset" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#144-158">source</a><a href="#impl-Debug-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl Debug for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#145-157">source</a><a href="#method.fmt" class="anchor"></a><h4 class="code-header">fn <a class="fnname">fmt</a>(&amp;self, f: &amp;mut Formatter&lt;'_&gt;) -&gt; Result</h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Display-for-FixedOffset" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#160-164">source</a><a href="#impl-Display-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl Display for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fmt-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#161-163">source</a><a href="#method.fmt-1" class="anchor"></a><h4 class="code-header">fn <a class="fnname">fmt</a>(&amp;self, f: &amp;mut Formatter&lt;'_&gt;) -&gt; Result</h4></section></summary><div class='docblock'>Formats the value using the given formatter. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Hash-for-FixedOffset" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#24">source</a><a href="#impl-Hash-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl Hash for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.hash" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#24">source</a><a href="#method.hash" class="anchor"></a><h4 class="code-header">fn <a class="fnname">hash</a>&lt;__H:&nbsp;Hasher&gt;(&amp;self, state: &amp;mut __H)</h4></section></summary><div class='docblock'>Feeds this value into the given [<code>Hasher</code>]. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.hash_slice" class="method trait-impl has-srclink"><span class="since rightside" title="Stable since Rust version 1.3.0">1.3.0</span><a href="#method.hash_slice" class="anchor"></a><h4 class="code-header">fn <a class="fnname">hash_slice</a>&lt;H&gt;(data: &amp;[Self], state: &amp;mut H)<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;H: Hasher,</span></h4></section></summary><div class='docblock'>Feeds a slice of this type into the given [<code>Hasher</code>]. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Offset-for-FixedOffset" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#138-142">source</a><a href="#impl-Offset-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.Offset.html" title="trait chrono::offset::Offset">Offset</a> for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.fix" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#139-141">source</a><a href="#method.fix" class="anchor"></a><h4 class="code-header">fn <a href="trait.Offset.html#tymethod.fix" class="fnname">fix</a>(&amp;self) -&gt; <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h4></section></summary><div class='docblock'>Returns the fixed offset from UTC to the local time stored.</div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-PartialEq%3CFixedOffset%3E-for-FixedOffset" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#24">source</a><a href="#impl-PartialEq%3CFixedOffset%3E-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl PartialEq&lt;<a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.eq" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#24">source</a><a href="#method.eq" class="anchor"></a><h4 class="code-header">fn <a class="fnname">eq</a>(&amp;self, other: &amp;<a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; bool</h4></section></summary><div class='docblock'>This method tests for <code>self</code> and <code>other</code> values to be equal, and is used
by <code>==</code>. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ne" class="method trait-impl has-srclink"><span class="since rightside" title="Stable since Rust version 1.0.0">1.0.0</span><a href="#method.ne" class="anchor"></a><h4 class="code-header">const fn <a class="fnname">ne</a>(&amp;self, other: &amp;Rhs) -&gt; bool</h4></section></summary><div class='docblock'>This method tests for <code>!=</code>. The default implementation is almost always
sufficient, and should not be overridden without very good reason. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Sub%3CFixedOffset%3E-for-DateTime%3CTz%3E" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#236-243">source</a><a href="#impl-Sub%3CFixedOffset%3E-for-DateTime%3CTz%3E" class="anchor"></a><h3 class="code-header">impl&lt;Tz:&nbsp;<a class="trait" href="trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>&gt; Sub&lt;<a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output-5" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output-5" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Output</a> = <a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</h4></section></summary><div class='docblock'>The resulting type after applying the <code>-</code> operator.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.sub-2" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#240-242">source</a><a href="#method.sub-2" class="anchor"></a><h4 class="code-header">fn <a class="fnname">sub</a>(self, rhs: <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</h4></section></summary><div class='docblock'>Performs the <code>-</code> operation. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Sub%3CFixedOffset%3E-for-NaiveDateTime" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#218-225">source</a><a href="#impl-Sub%3CFixedOffset%3E-for-NaiveDateTime" class="anchor"></a><h3 class="code-header">impl Sub&lt;<a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output-3" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output-3" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Output</a> = <a class="struct" href="../naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></h4></section></summary><div class='docblock'>The resulting type after applying the <code>-</code> operator.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.sub-1" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#222-224">source</a><a href="#method.sub-1" class="anchor"></a><h4 class="code-header">fn <a class="fnname">sub</a>(self, rhs: <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></h4></section></summary><div class='docblock'>Performs the <code>-</code> operation. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-Sub%3CFixedOffset%3E-for-NaiveTime" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#200-207">source</a><a href="#impl-Sub%3CFixedOffset%3E-for-NaiveTime" class="anchor"></a><h3 class="code-header">impl Sub&lt;<a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt; for <a class="struct" href="../naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Output-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Output-1" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Output</a> = <a class="struct" href="../naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></h4></section></summary><div class='docblock'>The resulting type after applying the <code>-</code> operator.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.sub" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#204-206">source</a><a href="#method.sub" class="anchor"></a><h4 class="code-header">fn <a class="fnname">sub</a>(self, rhs: <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="../naive/struct.NaiveTime.html" title="struct chrono::naive::NaiveTime">NaiveTime</a></h4></section></summary><div class='docblock'>Performs the <code>-</code> operation. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle" open><summary><section id="impl-TimeZone-for-FixedOffset" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#116-136">source</a><a href="#impl-TimeZone-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl <a class="trait" href="trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a> for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Offset" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Offset" class="anchor"></a><h4 class="code-header">type <a href="trait.TimeZone.html#associatedtype.Offset" class="associatedtype">Offset</a> = <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h4></section></summary><div class='docblock'>An associated offset type.
This type is used to store the actual offset in date and time types.
The original <code>TimeZone</code> value can be recovered via <code>TimeZone::from_offset</code>. <a href="trait.TimeZone.html#associatedtype.Offset">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_offset" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#119-121">source</a><a href="#method.from_offset" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#tymethod.from_offset" class="fnname">from_offset</a>(offset: &amp;<a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>) -&gt; <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h4></section></summary><div class='docblock'>Reconstructs the time zone from the offset.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.offset_from_local_date" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#123-125">source</a><a href="#method.offset_from_local_date" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#tymethod.offset_from_local_date" class="fnname">offset_from_local_date</a>(&amp;self, _local: &amp;<a class="struct" href="../naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="enum" href="enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt;</h4></section></summary><div class='docblock'>Creates the offset(s) for given local <code>NaiveDate</code> if possible.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.offset_from_local_datetime" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#126-128">source</a><a href="#method.offset_from_local_datetime" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#tymethod.offset_from_local_datetime" class="fnname">offset_from_local_datetime</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self,<br>&nbsp;&nbsp;&nbsp;&nbsp;_local: &amp;<a class="struct" href="../naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a><br>) -&gt; <a class="enum" href="enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a>&gt;</h4></section></summary><div class='docblock'>Creates the offset(s) for given local <code>NaiveDateTime</code> if possible.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.offset_from_utc_date" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#130-132">source</a><a href="#method.offset_from_utc_date" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#tymethod.offset_from_utc_date" class="fnname">offset_from_utc_date</a>(&amp;self, _utc: &amp;<a class="struct" href="../naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h4></section></summary><div class='docblock'>Creates the offset for given UTC <code>NaiveDate</code>. This cannot fail.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.offset_from_utc_datetime" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#133-135">source</a><a href="#method.offset_from_utc_datetime" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#tymethod.offset_from_utc_datetime" class="fnname">offset_from_utc_datetime</a>(&amp;self, _utc: &amp;<a class="struct" href="../naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h4></section></summary><div class='docblock'>Creates the offset for given UTC <code>NaiveDateTime</code>. This cannot fail.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.with_ymd_and_hms" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#227-241">source</a><a href="#method.with_ymd_and_hms" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.with_ymd_and_hms" class="fnname">with_ymd_and_hms</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self,<br>&nbsp;&nbsp;&nbsp;&nbsp;year: i32,<br>&nbsp;&nbsp;&nbsp;&nbsp;month: u32,<br>&nbsp;&nbsp;&nbsp;&nbsp;day: u32,<br>&nbsp;&nbsp;&nbsp;&nbsp;hour: u32,<br>&nbsp;&nbsp;&nbsp;&nbsp;min: u32,<br>&nbsp;&nbsp;&nbsp;&nbsp;sec: u32<br>) -&gt; <a class="enum" href="enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</h4></section></summary><div class='docblock'>Make a new <code>DateTime</code> from year, month, day, time components and current time zone. <a href="trait.TimeZone.html#method.with_ymd_and_hms">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ymd" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#252-254">source</a><a href="#method.ymd" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.ymd" class="fnname">ymd</a>(&amp;self, year: i32, month: u32, day: u32) -&gt; <a class="struct" href="../struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</h4></section></summary><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.4.23: use <code>with_ymd_and_hms()</code> instead</span></div></span><div class='docblock'>Makes a new <code>Date</code> from year, month, day and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="trait.TimeZone.html#method.ymd">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.ymd_opt" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#265-270">source</a><a href="#method.ymd_opt" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.ymd_opt" class="fnname">ymd_opt</a>(&amp;self, year: i32, month: u32, day: u32) -&gt; <a class="enum" href="enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</h4></section></summary><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.4.23: use <code>with_ymd_and_hms()</code> instead</span></div></span><div class='docblock'>Makes a new <code>Date</code> from year, month, day and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="trait.TimeZone.html#method.ymd_opt">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.yo" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#284-286">source</a><a href="#method.yo" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.yo" class="fnname">yo</a>(&amp;self, year: i32, ordinal: u32) -&gt; <a class="struct" href="../struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</h4></section></summary><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.4.23: use <code>from_local_datetime()</code> with a <code>NaiveDateTime</code> instead</span></div></span><div class='docblock'>Makes a new <code>Date</code> from year, day of year (DOY or “ordinal”) and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="trait.TimeZone.html#method.yo">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.yo_opt" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#300-305">source</a><a href="#method.yo_opt" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.yo_opt" class="fnname">yo_opt</a>(&amp;self, year: i32, ordinal: u32) -&gt; <a class="enum" href="enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</h4></section></summary><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.4.23: use <code>from_local_datetime()</code> with a <code>NaiveDateTime</code> instead</span></div></span><div class='docblock'>Makes a new <code>Date</code> from year, day of year (DOY or “ordinal”) and the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE. <a href="trait.TimeZone.html#method.yo_opt">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.isoywd" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#321-323">source</a><a href="#method.isoywd" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.isoywd" class="fnname">isoywd</a>(&amp;self, year: i32, week: u32, weekday: <a class="enum" href="../enum.Weekday.html" title="enum chrono::Weekday">Weekday</a>) -&gt; <a class="struct" href="../struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</h4></section></summary><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.4.23: use <code>from_local_datetime()</code> with a <code>NaiveDateTime</code> instead</span></div></span><div class='docblock'>Makes a new <code>Date</code> from ISO week date (year and week number), day of the week (DOW) and
the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE.
The resulting <code>Date</code> may have a different year from the input year. <a href="trait.TimeZone.html#method.isoywd">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.isoywd_opt" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#339-344">source</a><a href="#method.isoywd_opt" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.isoywd_opt" class="fnname">isoywd_opt</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self,<br>&nbsp;&nbsp;&nbsp;&nbsp;year: i32,<br>&nbsp;&nbsp;&nbsp;&nbsp;week: u32,<br>&nbsp;&nbsp;&nbsp;&nbsp;weekday: <a class="enum" href="../enum.Weekday.html" title="enum chrono::Weekday">Weekday</a><br>) -&gt; <a class="enum" href="enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</h4></section></summary><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.4.23: use <code>from_local_datetime()</code> with a <code>NaiveDateTime</code> instead</span></div></span><div class='docblock'>Makes a new <code>Date</code> from ISO week date (year and week number), day of the week (DOW) and
the current time zone.
This assumes the proleptic Gregorian calendar, with the year 0 being 1 BCE.
The resulting <code>Date</code> may have a different year from the input year. <a href="trait.TimeZone.html#method.isoywd_opt">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.timestamp" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#353-355">source</a><a href="#method.timestamp" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.timestamp" class="fnname">timestamp</a>(&amp;self, secs: i64, nsecs: u32) -&gt; <a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</h4></section></summary><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.4.23: use <code>timestamp_opt()</code> instead</span></div></span><div class='docblock'>Makes a new <code>DateTime</code> from the number of non-leap seconds
since January 1, 1970 0:00:00 UTC (aka “UNIX timestamp”)
and the number of nanoseconds since the last whole non-leap second. <a href="trait.TimeZone.html#method.timestamp">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.timestamp_opt" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#371-376">source</a><a href="#method.timestamp_opt" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.timestamp_opt" class="fnname">timestamp_opt</a>(&amp;self, secs: i64, nsecs: u32) -&gt; <a class="enum" href="enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</h4></section></summary><div class='docblock'>Makes a new <code>DateTime</code> from the number of non-leap seconds
since January 1, 1970 0:00:00 UTC (aka “UNIX timestamp”)
and the number of nanoseconds since the last whole non-leap second. <a href="trait.TimeZone.html#method.timestamp_opt">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.timestamp_millis" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#384-386">source</a><a href="#method.timestamp_millis" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.timestamp_millis" class="fnname">timestamp_millis</a>(&amp;self, millis: i64) -&gt; <a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</h4></section></summary><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.4.23: use <code>timestamp_millis_opt()</code> instead</span></div></span><div class='docblock'>Makes a new <code>DateTime</code> from the number of non-leap milliseconds
since January 1, 1970 0:00:00 UTC (aka “UNIX timestamp”). <a href="trait.TimeZone.html#method.timestamp_millis">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.timestamp_millis_opt" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#405-412">source</a><a href="#method.timestamp_millis_opt" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.timestamp_millis_opt" class="fnname">timestamp_millis_opt</a>(&amp;self, millis: i64) -&gt; <a class="enum" href="enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</h4></section></summary><div class='docblock'>Makes a new <code>DateTime</code> from the number of non-leap milliseconds
since January 1, 1970 0:00:00 UTC (aka “UNIX timestamp”). <a href="trait.TimeZone.html#method.timestamp_millis_opt">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.timestamp_nanos" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#427-434">source</a><a href="#method.timestamp_nanos" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.timestamp_nanos" class="fnname">timestamp_nanos</a>(&amp;self, nanos: i64) -&gt; <a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</h4></section></summary><div class='docblock'>Makes a new <code>DateTime</code> from the number of non-leap nanoseconds
since January 1, 1970 0:00:00 UTC (aka “UNIX timestamp”). <a href="trait.TimeZone.html#method.timestamp_nanos">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.datetime_from_str" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#447-451">source</a><a href="#method.datetime_from_str" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.datetime_from_str" class="fnname">datetime_from_str</a>(&amp;self, s: &amp;str, fmt: &amp;str) -&gt; <a class="type" href="../format/type.ParseResult.html" title="type chrono::format::ParseResult">ParseResult</a>&lt;<a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</h4></section></summary><div class='docblock'>Parses a string with the specified format string and returns a
<code>DateTime</code> with the current offset. <a href="trait.TimeZone.html#method.datetime_from_str">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_local_date" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#466-471">source</a><a href="#method.from_local_date" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.from_local_date" class="fnname">from_local_date</a>(&amp;self, local: &amp;<a class="struct" href="../naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="enum" href="enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;&gt;</h4></section></summary><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.4.23: use <code>from_local_datetime()</code> instead</span></div></span><div class='docblock'>Converts the local <code>NaiveDate</code> to the timezone-aware <code>Date</code> if possible.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_local_datetime" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#475-478">source</a><a href="#method.from_local_datetime" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.from_local_datetime" class="fnname">from_local_datetime</a>(<br>&nbsp;&nbsp;&nbsp;&nbsp;&amp;self,<br>&nbsp;&nbsp;&nbsp;&nbsp;local: &amp;<a class="struct" href="../naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a><br>) -&gt; <a class="enum" href="enum.LocalResult.html" title="enum chrono::offset::LocalResult">LocalResult</a>&lt;<a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;&gt;</h4></section></summary><div class='docblock'>Converts the local <code>NaiveDateTime</code> to the timezone-aware <code>DateTime</code> if possible.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_utc_date" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#491-493">source</a><a href="#method.from_utc_date" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.from_utc_date" class="fnname">from_utc_date</a>(&amp;self, utc: &amp;<a class="struct" href="../naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a>) -&gt; <a class="struct" href="../struct.Date.html" title="struct chrono::Date">Date</a>&lt;Self&gt;</h4></section></summary><span class="item-info"><div class="stab deprecated"><span class="emoji">👎</span><span>Deprecated since 0.4.23: use <code>from_utc_datetime()</code> instead</span></div></span><div class='docblock'>Converts the UTC <code>NaiveDate</code> to the local time.
The UTC is continuous and thus this cannot fail (but can give the duplicate local time). <a href="trait.TimeZone.html#method.from_utc_date">Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from_utc_datetime" class="method trait-impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/mod.rs.html#498-500">source</a><a href="#method.from_utc_datetime" class="anchor"></a><h4 class="code-header">fn <a href="trait.TimeZone.html#method.from_utc_datetime" class="fnname">from_utc_datetime</a>(&amp;self, utc: &amp;<a class="struct" href="../naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a>) -&gt; <a class="struct" href="../struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Self&gt;</h4></section></summary><div class='docblock'>Converts the UTC <code>NaiveDateTime</code> to the local time.
The UTC is continuous and thus this cannot fail (but can give the duplicate local time). <a href="trait.TimeZone.html#method.from_utc_datetime">Read more</a></div></details></div></details><section id="impl-Copy-for-FixedOffset" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#24">source</a><a href="#impl-Copy-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl Copy for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section><section id="impl-Eq-for-FixedOffset" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#24">source</a><a href="#impl-Eq-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl Eq for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section><section id="impl-StructuralEq-for-FixedOffset" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#24">source</a><a href="#impl-StructuralEq-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl StructuralEq for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section><section id="impl-StructuralPartialEq-for-FixedOffset" class="impl has-srclink"><a class="srclink rightside" href="../../src/chrono/offset/fixed.rs.html#24">source</a><a href="#impl-StructuralPartialEq-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl StructuralPartialEq for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section></div><h2 id="synthetic-implementations" class="small-section-header">Auto Trait Implementations<a href="#synthetic-implementations" class="anchor"></a></h2><div id="synthetic-implementations-list"><section id="impl-RefUnwindSafe-for-FixedOffset" class="impl has-srclink"><a href="#impl-RefUnwindSafe-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl RefUnwindSafe for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section><section id="impl-Send-for-FixedOffset" class="impl has-srclink"><a href="#impl-Send-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl Send for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section><section id="impl-Sync-for-FixedOffset" class="impl has-srclink"><a href="#impl-Sync-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl Sync for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section><section id="impl-Unpin-for-FixedOffset" class="impl has-srclink"><a href="#impl-Unpin-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl Unpin for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section><section id="impl-UnwindSafe-for-FixedOffset" class="impl has-srclink"><a href="#impl-UnwindSafe-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl UnwindSafe for <a class="struct" href="struct.FixedOffset.html" title="struct chrono::offset::FixedOffset">FixedOffset</a></h3></section></div><h2 id="blanket-implementations" class="small-section-header">Blanket Implementations<a href="#blanket-implementations" class="anchor"></a></h2><div id="blanket-implementations-list"><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Any-for-FixedOffset" class="impl has-srclink"><a href="#impl-Any-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Any for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: 'static + ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.type_id" class="method trait-impl has-srclink"><a href="#method.type_id" class="anchor"></a><h4 class="code-header">fn <a class="fnname">type_id</a>(&amp;self) -&gt; TypeId</h4></section></summary><div class='docblock'>Gets the <code>TypeId</code> of <code>self</code>. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Borrow%3CT%3E-for-FixedOffset" class="impl has-srclink"><a href="#impl-Borrow%3CT%3E-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; Borrow&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow</a>(&amp;self) -&gt; &amp;T</h4></section></summary><div class='docblock'>Immutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-BorrowMut%3CT%3E-for-FixedOffset" class="impl has-srclink"><a href="#impl-BorrowMut%3CT%3E-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; BorrowMut&lt;T&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.borrow_mut" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/91522" title="Tracking issue for const_borrow">unstable</a></span><a href="#method.borrow_mut" class="anchor"></a><h4 class="code-header">fn <a class="fnname">borrow_mut</a>(&amp;mut self) -&gt; &amp;mut T</h4></section></summary><div class='docblock'>Mutably borrows from an owned value. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-From%3CT%3E-for-FixedOffset" class="impl has-srclink"><a href="#impl-From%3CT%3E-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; From&lt;T&gt; for T</h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.from" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">from</a>(t: T) -&gt; T</h4></section></summary><div class="docblock"><p>Returns the argument unchanged.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-Into%3CU%3E-for-FixedOffset" class="impl has-srclink"><a href="#impl-Into%3CU%3E-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; Into&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: From&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">into</a>(self) -&gt; U</h4></section></summary><div class="docblock"><p>Calls <code>U::from(self)</code>.</p>
<p>That is, this conversion is whatever the implementation of
<code>[From]&lt;T&gt; for U</code> chooses to do.</p>
</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToOwned-for-FixedOffset" class="impl has-srclink"><a href="#impl-ToOwned-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; ToOwned for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Clone,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Owned" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Owned" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Owned</a> = T</h4></section></summary><div class='docblock'>The resulting type after obtaining ownership.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_owned" class="method trait-impl has-srclink"><a href="#method.to_owned" class="anchor"></a><h4 class="code-header">fn <a class="fnname">to_owned</a>(&amp;self) -&gt; T</h4></section></summary><div class='docblock'>Creates owned data from borrowed data, usually by cloning. <a>Read more</a></div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.clone_into" class="method trait-impl has-srclink"><a href="#method.clone_into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">clone_into</a>(&amp;self, target: &amp;mut T)</h4></section></summary><div class='docblock'>Uses borrowed data to replace owned data, usually by cloning. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-ToString-for-FixedOffset" class="impl has-srclink"><a href="#impl-ToString-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl&lt;T&gt; ToString for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;T: Display + ?Sized,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle method-toggle" open><summary><section id="method.to_string" class="method trait-impl has-srclink"><a href="#method.to_string" class="anchor"></a><h4 class="code-header">default fn <a class="fnname">to_string</a>(&amp;self) -&gt; String</h4></section></summary><div class='docblock'>Converts the given value to a <code>String</code>. <a>Read more</a></div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryFrom%3CU%3E-for-FixedOffset" class="impl has-srclink"><a href="#impl-TryFrom%3CU%3E-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryFrom&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: Into&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error-1" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error-1" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = Infallible</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_from" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_from" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_from</a>(value: U) -&gt; Result&lt;T, &lt;T as TryFrom&lt;U&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details><details class="rustdoc-toggle implementors-toggle"><summary><section id="impl-TryInto%3CU%3E-for-FixedOffset" class="impl has-srclink"><a href="#impl-TryInto%3CU%3E-for-FixedOffset" class="anchor"></a><h3 class="code-header">impl&lt;T, U&gt; TryInto&lt;U&gt; for T<span class="where fmt-newline">where<br>&nbsp;&nbsp;&nbsp;&nbsp;U: TryFrom&lt;T&gt;,</span></h3></section></summary><div class="impl-items"><details class="rustdoc-toggle" open><summary><section id="associatedtype.Error" class="associatedtype trait-impl has-srclink"><a href="#associatedtype.Error" class="anchor"></a><h4 class="code-header">type <a class="associatedtype">Error</a> = &lt;U as TryFrom&lt;T&gt;&gt;::Error</h4></section></summary><div class='docblock'>The type returned in the event of a conversion error.</div></details><details class="rustdoc-toggle method-toggle" open><summary><section id="method.try_into" class="method trait-impl has-srclink"><span class="since rightside" title="const unstable">const: <a href="https://github.com/rust-lang/rust/issues/88674" title="Tracking issue for const_convert">unstable</a></span><a href="#method.try_into" class="anchor"></a><h4 class="code-header">fn <a class="fnname">try_into</a>(self) -&gt; Result&lt;U, &lt;U as TryFrom&lt;T&gt;&gt;::Error&gt;</h4></section></summary><div class='docblock'>Performs the conversion.</div></details></div></details></div></section></div></main><div id="rustdoc-vars" data-root-path="../../" data-current-crate="chrono" data-themes="ayu,dark,light" data-resource-suffix="" data-rustdoc-version="1.66.0-nightly (5c8bff74b 2022-10-21)" ></div></body></html>