Browse Source

Datetime

pull/164/head
Jure Šorn 1 year ago
parent
commit
2bb1f5448a
2 changed files with 4 additions and 4 deletions
  1. 4
      README.md
  2. 4
      index.html

4
README.md

@ -619,8 +619,8 @@ from dateutil.tz import tzlocal, gettz, datetime_exists, resolve_imaginary
<tzinfo> = timezone(<timedelta>) # Timezone with fixed offset from UTC. <tzinfo> = timezone(<timedelta>) # Timezone with fixed offset from UTC.
<tzinfo> = tzlocal() # Local timezone. Also gettz(). <tzinfo> = tzlocal() # Local timezone. Also gettz().
<tzinfo> = gettz('<Continent>/<City>') # 'Continent/City_Name' timezone or None. <tzinfo> = gettz('<Continent>/<City>') # 'Continent/City_Name' timezone or None.
<DTa> = <DT>.astimezone(<tzinfo>) # Datetime, converted to the passed timezone.
<Ta/DTa> = <T/DT>.replace(tzinfo=<tzinfo>) # Unconverted object with a new timezone.
<DTa> = <DT>.astimezone([<tzinfo>]) # Converts DT to the passed or local timezone.
<Ta/DTa> = <T/DT>.replace(tzinfo=<tzinfo>) # Changes object's timezone without conversion.
``` ```
* **Standard library's zoneinfo.ZoneInfo() can be used instead of gettz() on Python 3.9 and later. It requires 'tzdata' package on Windows.** * **Standard library's zoneinfo.ZoneInfo() can be used instead of gettz() on Python 3.9 and later. It requires 'tzdata' package on Windows.**

4
index.html

@ -546,8 +546,8 @@ Point(x=<span class="hljs-number">1</span>, y=<span class="hljs-number">2</span>
&lt;tzinfo&gt; = timezone(&lt;timedelta&gt;) <span class="hljs-comment"># Timezone with fixed offset from UTC.</span> &lt;tzinfo&gt; = timezone(&lt;timedelta&gt;) <span class="hljs-comment"># Timezone with fixed offset from UTC.</span>
&lt;tzinfo&gt; = tzlocal() <span class="hljs-comment"># Local timezone. Also gettz().</span> &lt;tzinfo&gt; = tzlocal() <span class="hljs-comment"># Local timezone. Also gettz().</span>
&lt;tzinfo&gt; = gettz(<span class="hljs-string">'&lt;Continent&gt;/&lt;City&gt;'</span>) <span class="hljs-comment"># 'Continent/City_Name' timezone or None.</span> &lt;tzinfo&gt; = gettz(<span class="hljs-string">'&lt;Continent&gt;/&lt;City&gt;'</span>) <span class="hljs-comment"># 'Continent/City_Name' timezone or None.</span>
&lt;DTa&gt; = &lt;DT&gt;.astimezone(&lt;tzinfo&gt;) <span class="hljs-comment"># Datetime, converted to the passed timezone.</span>
&lt;Ta/DTa&gt; = &lt;T/DT&gt;.replace(tzinfo=&lt;tzinfo&gt;) <span class="hljs-comment"># Unconverted object with a new timezone.</span>
&lt;DTa&gt; = &lt;DT&gt;.astimezone([&lt;tzinfo&gt;]) <span class="hljs-comment"># Converts DT to the passed or local timezone.</span>
&lt;Ta/DTa&gt; = &lt;T/DT&gt;.replace(tzinfo=&lt;tzinfo&gt;) <span class="hljs-comment"># Changes object's timezone without conversion.</span>
</code></pre></div> </code></pre></div>
<ul> <ul>

Loading…
Cancel
Save