This repository has been archived on 2022-04-04. You can view files and clone it, but cannot push or open issues or pull requests.
ludum-dare-50/rustdoc/chrono/trait.Datelike.html

64 lines
26 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!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 common set of methods for date component."><meta name="keywords" content="rust, rustlang, rust-lang, Datelike"><title>Datelike in chrono - 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" type="text/css" href="../normalize.css"><link rel="stylesheet" type="text/css" href="../rustdoc.css" id="mainThemeStyle"><link rel="stylesheet" type="text/css" href="../ayu.css" disabled><link rel="stylesheet" type="text/css" href="../dark.css" disabled><link rel="stylesheet" type="text/css" href="../light.css" id="themeStyle"><script id="default-settings" ></script><script src="../storage.js"></script><script src="../crates.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 trait"><!--[if lte IE 11]><div class="warning">This old browser is unsupported and will most likely display funky things.</div><![endif]--><nav class="sidebar"><div class="sidebar-menu" role="button">&#9776;</div><a class="sidebar-logo" href="../chrono/index.html"><div class="logo-container"><img class="rust-logo" src="../rust-logo.png" alt="logo"></div>
</a><h2 class="location">Trait Datelike</h2><div class="sidebar-elems"><div class="block items"><h3 class="sidebar-title"><a href="#required-methods">Required Methods</a></h3><div class="sidebar-links"><a href="#tymethod.day">day</a><a href="#tymethod.day0">day0</a><a href="#tymethod.iso_week">iso_week</a><a href="#tymethod.month">month</a><a href="#tymethod.month0">month0</a><a href="#tymethod.ordinal">ordinal</a><a href="#tymethod.ordinal0">ordinal0</a><a href="#tymethod.weekday">weekday</a><a href="#tymethod.with_day">with_day</a><a href="#tymethod.with_day0">with_day0</a><a href="#tymethod.with_month">with_month</a><a href="#tymethod.with_month0">with_month0</a><a href="#tymethod.with_ordinal">with_ordinal</a><a href="#tymethod.with_ordinal0">with_ordinal0</a><a href="#tymethod.with_year">with_year</a><a href="#tymethod.year">year</a></div><h3 class="sidebar-title"><a href="#provided-methods">Provided Methods</a></h3><div class="sidebar-links"><a href="#method.num_days_from_ce">num_days_from_ce</a><a href="#method.year_ce">year_ce</a></div><h3 class="sidebar-title"><a href="#implementors">Implementors</a></h3></div><h2 class="location">Other items in<br><a href="index.html">chrono</a></h2><div id="sidebar-vars" data-name="Datelike" data-ty="trait" data-relpath=""></div><script defer src="sidebar-items.js"></script></div></nav><main><div class="width-limiter"><div class="sub-container"><a class="sub-logo-container" href="../chrono/index.html"><img class="rust-logo" src="../rust-logo.png" alt="logo"></a><nav class="sub"><div class="theme-picker"><button id="theme-picker" aria-label="Pick another theme!" aria-haspopup="menu" title="themes"><img width="18" height="18" alt="Pick another theme!" src="../brush.svg"></button><div id="theme-choices" role="menu"></div></div><form class="search-form"><div class="search-container"><div><select id="crate-search"><option value="All crates">All crates</option></select><input class="search-input" name="search" autocomplete="off" spellcheck="false" placeholder="Click or press S to search, ? for more options…" type="search"></div><button type="button" id="help-button" title="help">?</button><a id="settings-menu" href="../settings.html" title="settings"><img width="18" height="18" alt="Change settings" src="../wheel.svg"></a></div></form></nav></div><section id="main-content" class="content"><h1 class="fqn"><span class="in-band">Trait <a href="index.html">chrono</a>::<wbr><a class="trait" href="#">Datelike</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></span><span class="out-of-band"><span id="render-detail"><a id="toggle-all-docs" href="javascript:void(0)" title="collapse all docs">[<span class="inner">&#x2212;</span>]</a></span><a class="srclink" href="../src/chrono/lib.rs.html#1245-1360" title="goto source code">[src]</a></span></h1><div class="docblock item-decl"><pre class="rust trait"><code>pub trait Datelike: <a class="trait" href="https://doc.rust-lang.org/1.59.0/core/marker/trait.Sized.html" title="trait core::marker::Sized">Sized</a> {
<details class="rustdoc-toggle type-contents-toggle"><summary class="hideme"><span>Show 18 methods</span></summary> fn <a href="#tymethod.year" class="fnname">year</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.i32.html">i32</a>;
<div class="item-spacer"></div> fn <a href="#tymethod.month" class="fnname">month</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>;
<div class="item-spacer"></div> fn <a href="#tymethod.month0" class="fnname">month0</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>;
<div class="item-spacer"></div> fn <a href="#tymethod.day" class="fnname">day</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>;
<div class="item-spacer"></div> fn <a href="#tymethod.day0" class="fnname">day0</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>;
<div class="item-spacer"></div> fn <a href="#tymethod.ordinal" class="fnname">ordinal</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>;
<div class="item-spacer"></div> fn <a href="#tymethod.ordinal0" class="fnname">ordinal0</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>;
<div class="item-spacer"></div> fn <a href="#tymethod.weekday" class="fnname">weekday</a>(&amp;self) -&gt; <a class="enum" href="enum.Weekday.html" title="enum chrono::Weekday">Weekday</a>;
<div class="item-spacer"></div> fn <a href="#tymethod.iso_week" class="fnname">iso_week</a>(&amp;self) -&gt; <a class="struct" href="naive/struct.IsoWeek.html" title="struct chrono::naive::IsoWeek">IsoWeek</a>;
<div class="item-spacer"></div> fn <a href="#tymethod.with_year" class="fnname">with_year</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.i32.html">i32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;;
<div class="item-spacer"></div> fn <a href="#tymethod.with_month" class="fnname">with_month</a>(&amp;self, month: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;;
<div class="item-spacer"></div> fn <a href="#tymethod.with_month0" class="fnname">with_month0</a>(&amp;self, month0: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;;
<div class="item-spacer"></div> fn <a href="#tymethod.with_day" class="fnname">with_day</a>(&amp;self, day: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;;
<div class="item-spacer"></div> fn <a href="#tymethod.with_day0" class="fnname">with_day0</a>(&amp;self, day0: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;;
<div class="item-spacer"></div> fn <a href="#tymethod.with_ordinal" class="fnname">with_ordinal</a>(&amp;self, ordinal: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;;
<div class="item-spacer"></div> fn <a href="#tymethod.with_ordinal0" class="fnname">with_ordinal0</a>(&amp;self, ordinal0: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;;
fn <a href="#method.year_ce" class="fnname">year_ce</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.bool.html">bool</a>, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a> { ... }
<div class="item-spacer"></div> fn <a href="#method.num_days_from_ce" class="fnname">num_days_from_ce</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.i32.html">i32</a> { ... }
</details>}</code></pre></div><details class="rustdoc-toggle top-doc" open><summary class="hideme"><span>Expand description</span></summary><div class="docblock"><p>The common set of methods for date component.</p>
</div></details><h2 id="required-methods" class="small-section-header">Required methods<a href="#required-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="tymethod.year" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1247" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.year" class="fnname">year</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.i32.html">i32</a></h4></div></summary><div class="docblock"><p>Returns the year number in the <a href="./naive/struct.NaiveDate.html#calendar-date">calendar date</a>.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.month" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1264" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.month" class="fnname">month</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a></h4></div></summary><div class="docblock"><p>Returns the month number starting from 1.</p>
<p>The return value ranges from 1 to 12.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.month0" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1269" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.month0" class="fnname">month0</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a></h4></div></summary><div class="docblock"><p>Returns the month number starting from 0.</p>
<p>The return value ranges from 0 to 11.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.day" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1274" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.day" class="fnname">day</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a></h4></div></summary><div class="docblock"><p>Returns the day of month starting from 1.</p>
<p>The return value ranges from 1 to 31. (The last day of month differs by months.)</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.day0" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1279" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.day0" class="fnname">day0</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a></h4></div></summary><div class="docblock"><p>Returns the day of month starting from 0.</p>
<p>The return value ranges from 0 to 30. (The last day of month differs by months.)</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.ordinal" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1284" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.ordinal" class="fnname">ordinal</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a></h4></div></summary><div class="docblock"><p>Returns the day of year starting from 1.</p>
<p>The return value ranges from 1 to 366. (The last day of year differs by years.)</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.ordinal0" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1289" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.ordinal0" class="fnname">ordinal0</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a></h4></div></summary><div class="docblock"><p>Returns the day of year starting from 0.</p>
<p>The return value ranges from 0 to 365. (The last day of year differs by years.)</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.weekday" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1292" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.weekday" class="fnname">weekday</a>(&amp;self) -&gt; <a class="enum" href="enum.Weekday.html" title="enum chrono::Weekday">Weekday</a></h4></div></summary><div class="docblock"><p>Returns the day of week.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.iso_week" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1295" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.iso_week" class="fnname">iso_week</a>(&amp;self) -&gt; <a class="struct" href="naive/struct.IsoWeek.html" title="struct chrono::naive::IsoWeek">IsoWeek</a></h4></div></summary><div class="docblock"><p>Returns the ISO week.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.with_year" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1300" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.with_year" class="fnname">with_year</a>(&amp;self, year: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.i32.html">i32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</h4></div></summary><div class="docblock"><p>Makes a new value with the year number changed.</p>
<p>Returns <code>None</code> when the resulting value would be invalid.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.with_month" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1305" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.with_month" class="fnname">with_month</a>(&amp;self, month: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</h4></div></summary><div class="docblock"><p>Makes a new value with the month number (starting from 1) changed.</p>
<p>Returns <code>None</code> when the resulting value would be invalid.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.with_month0" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1310" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.with_month0" class="fnname">with_month0</a>(&amp;self, month0: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</h4></div></summary><div class="docblock"><p>Makes a new value with the month number (starting from 0) changed.</p>
<p>Returns <code>None</code> when the resulting value would be invalid.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.with_day" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1315" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.with_day" class="fnname">with_day</a>(&amp;self, day: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</h4></div></summary><div class="docblock"><p>Makes a new value with the day of month (starting from 1) changed.</p>
<p>Returns <code>None</code> when the resulting value would be invalid.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.with_day0" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1320" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.with_day0" class="fnname">with_day0</a>(&amp;self, day0: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</h4></div></summary><div class="docblock"><p>Makes a new value with the day of month (starting from 0) changed.</p>
<p>Returns <code>None</code> when the resulting value would be invalid.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.with_ordinal" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1325" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.with_ordinal" class="fnname">with_ordinal</a>(&amp;self, ordinal: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</h4></div></summary><div class="docblock"><p>Makes a new value with the day of year (starting from 1) changed.</p>
<p>Returns <code>None</code> when the resulting value would be invalid.</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="tymethod.with_ordinal0" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1330" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#tymethod.with_ordinal0" class="fnname">with_ordinal0</a>(&amp;self, ordinal0: <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a>) -&gt; <a class="enum" href="https://doc.rust-lang.org/1.59.0/core/option/enum.Option.html" title="enum core::option::Option">Option</a>&lt;Self&gt;</h4></div></summary><div class="docblock"><p>Makes a new value with the day of year (starting from 0) changed.</p>
<p>Returns <code>None</code> when the resulting value would be invalid.</p>
</div></details></div><h2 id="provided-methods" class="small-section-header">Provided methods<a href="#provided-methods" class="anchor"></a></h2><div class="methods"><details class="rustdoc-toggle" open><summary><div id="method.year_ce" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1252-1259" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#method.year_ce" class="fnname">year_ce</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">(</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.bool.html">bool</a>, <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.u32.html">u32</a><a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.tuple.html">)</a></h4></div></summary><div class="docblock"><p>Returns the absolute year number starting from 1 with a boolean flag,
which is false when the year predates the epoch (BCE/BC) and true otherwise (CE/AD).</p>
</div></details><details class="rustdoc-toggle" open><summary><div id="method.num_days_from_ce" class="method has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/lib.rs.html#1344-1359" title="goto source code">[src]</a></div><h4 class="code-header">fn <a href="#method.num_days_from_ce" class="fnname">num_days_from_ce</a>(&amp;self) -&gt; <a class="primitive" href="https://doc.rust-lang.org/1.59.0/std/primitive.i32.html">i32</a></h4></div></summary><div class="docblock"><p>Counts the days in the proleptic Gregorian calendar, with January 1, Year 1 (CE) as day 1.</p>
<h5 id="examples" class="section-header"><a href="#examples">Examples</a></h5>
<div class="example-wrap"><pre class="rust rust-example-rendered"><code><span class="kw">use</span> <span class="ident">chrono</span>::{<span class="ident">NaiveDate</span>, <span class="ident">Datelike</span>};
<span class="macro">assert_eq!</span>(<span class="ident">NaiveDate::from_ymd</span>(<span class="number">1970</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">num_days_from_ce</span>(), <span class="number">719_163</span>);
<span class="macro">assert_eq!</span>(<span class="ident">NaiveDate::from_ymd</span>(<span class="number">2</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">num_days_from_ce</span>(), <span class="number">366</span>);
<span class="macro">assert_eq!</span>(<span class="ident">NaiveDate::from_ymd</span>(<span class="number">1</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">num_days_from_ce</span>(), <span class="number">1</span>);
<span class="macro">assert_eq!</span>(<span class="ident">NaiveDate::from_ymd</span>(<span class="number">0</span>, <span class="number">1</span>, <span class="number">1</span>).<span class="ident">num_days_from_ce</span>(), <span class="op">-</span><span class="number">365</span>);</code></pre></div>
</div></details></div><h2 id="implementors" class="small-section-header">Implementors<a href="#implementors" class="anchor"></a></h2><div class="item-list" id="implementors-list"><div id="impl-Datelike" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/naive/date.rs.html#1102-1442" title="goto source code">[src]</a></div><a href="#impl-Datelike" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.Datelike.html" title="trait chrono::Datelike">Datelike</a> for <a class="struct" href="naive/struct.NaiveDate.html" title="struct chrono::naive::NaiveDate">NaiveDate</a></h3></div><div id="impl-Datelike-1" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/naive/datetime.rs.html#702-1018" title="goto source code">[src]</a></div><a href="#impl-Datelike-1" class="anchor"></a><h3 class="code-header in-band">impl <a class="trait" href="trait.Datelike.html" title="trait chrono::Datelike">Datelike</a> for <a class="struct" href="naive/struct.NaiveDateTime.html" title="struct chrono::naive::NaiveDateTime">NaiveDateTime</a></h3></div><div id="impl-Datelike-2" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/date.rs.html#336-408" title="goto source code">[src]</a></div><a href="#impl-Datelike-2" class="anchor"></a><h3 class="code-header in-band">impl&lt;Tz:&nbsp;<a class="trait" href="offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>&gt; <a class="trait" href="trait.Datelike.html" title="trait chrono::Datelike">Datelike</a> for <a class="struct" href="struct.Date.html" title="struct chrono::Date">Date</a>&lt;Tz&gt;</h3></div><div id="impl-Datelike-3" class="impl has-srclink"><div class="rightside"><a class="srclink" href="../src/chrono/datetime.rs.html#535-607" title="goto source code">[src]</a></div><a href="#impl-Datelike-3" class="anchor"></a><h3 class="code-header in-band">impl&lt;Tz:&nbsp;<a class="trait" href="offset/trait.TimeZone.html" title="trait chrono::offset::TimeZone">TimeZone</a>&gt; <a class="trait" href="trait.Datelike.html" title="trait chrono::Datelike">Datelike</a> for <a class="struct" href="struct.DateTime.html" title="struct chrono::DateTime">DateTime</a>&lt;Tz&gt;</h3></div></div><script type="text/javascript" src="../implementors/chrono/trait.Datelike.js" async></script></section><section id="search" class="content hidden"></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.59.0 (9d1b2106e 2022-02-23)" ></div>
</body></html>