Skip to content

Commit 7bacc33

Browse files
committed
Datetime, Image draw
1 parent b05b841 commit 7bacc33

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -598,10 +598,10 @@ from dateutil.tz import UTC, tzlocal, gettz, datetime_exists, resolve_imaginary
598598

599599
### Constructors
600600
```python
601-
<D> = date(year, month, day)
602-
<T> = time(hour=0, minute=0, second=0, microsecond=0, tzinfo=None, fold=0)
603-
<DT> = datetime(year, month, day, hour=0, minute=0, second=0, ...)
604-
<TD> = timedelta(weeks=0, days=0, hours=0, minutes=0, seconds=0, ...)
601+
<D> = date(year, month, day) # Only accepts valid dates from 1 to 9999 AD.
602+
<T> = time(hour=0, minute=0, second=0) # Also: `microsecond=0, tzinfo=None, fold=0`.
603+
<DT> = datetime(year, month, day, hour=0) # Also: `minute=0, second=0, microsecond=0, …`.
604+
<TD> = timedelta(weeks=0, days=0, hours=0) # Also: `minutes=0, seconds=0, microsecond=0`.
605605
```
606606
* **Use `'<D/DT>.weekday()'` to get the day of the week as an int, with Monday being 0.**
607607
* **`'fold=1'` means the second pass in case of time jumping back for one hour.**
@@ -637,7 +637,7 @@ from dateutil.tz import UTC, tzlocal, gettz, datetime_exists, resolve_imaginary
637637

638638
### Decode
639639
```python
640-
<str> = <D/T/DT>.isoformat(sep='T') # Also timespec='auto/hours/minutes/seconds/…'.
640+
<str> = <D/T/DT>.isoformat(sep='T') # Also: `timespec='auto/hours/minutes/seconds/…'`.
641641
<str> = <D/T/DT>.strftime('<format>') # Custom string representation.
642642
<int> = <D/DT>.toordinal() # Days since Gregorian NYE 1, ignoring time and tz.
643643
<float> = <DTn>.timestamp() # Seconds since the Epoch, from DTn in local tz.
@@ -2788,11 +2788,11 @@ from PIL import ImageDraw
27882788

27892789
```python
27902790
<ImageDraw>.point((x, y)) # Truncates floats into ints.
2791-
<ImageDraw>.line((x1, y1, x2, y2 [, ...])) # To get anti-aliasing use images's resize().
2791+
<ImageDraw>.line((x1, y1, x2, y2 [, ...])) # To get anti-aliasing use Image's resize().
27922792
<ImageDraw>.arc((x1, y1, x2, y2), deg1, deg2) # Always draws in clockwise direction.
2793-
<ImageDraw>.rectangle((x1, y1, x2, y2)) # To rotate use image's rotate() and paste().
2794-
<ImageDraw>.polygon((x1, y1, x2, y2, ...)) # Last and first point get connected.
2795-
<ImageDraw>.ellipse((x1, y1, x2, y2)) # To rotate use image's rotate() and paste().
2793+
<ImageDraw>.rectangle((x1, y1, x2, y2)) # To rotate use Image's rotate() and paste().
2794+
<ImageDraw>.polygon((x1, y1, x2, y2, ...)) # Last point gets connected to the first.
2795+
<ImageDraw>.ellipse((x1, y1, x2, y2)) # To rotate use Image's rotate() and paste().
27962796
```
27972797
* **Use `'fill=<color>'` to set the primary color.**
27982798
* **Use `'width=<int>'` to set the width of lines or contours.**

index.html

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454

5555
<body>
5656
<header>
57-
<aside>July 24, 2022</aside>
57+
<aside>July 25, 2022</aside>
5858
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
5959
</header>
6060

@@ -528,10 +528,10 @@
528528
</code></pre></div>
529529

530530

531-
<div><h3 id="constructors">Constructors</h3><pre><code class="python language-python apache hljs">&lt;D&gt; = date(year, month, day)
532-
&lt;T&gt; = time(hour=<span class="hljs-number">0</span>, minute=<span class="hljs-number">0</span>, second=<span class="hljs-number">0</span>, microsecond=<span class="hljs-number">0</span>, tzinfo=<span class="hljs-keyword">None</span>, fold=<span class="hljs-number">0</span>)
533-
&lt;DT&gt; = datetime(year, month, day, hour=<span class="hljs-number">0</span>, minute=<span class="hljs-number">0</span>, second=<span class="hljs-number">0</span>, ...)
534-
&lt;TD&gt; = timedelta(weeks=<span class="hljs-number">0</span>, days=<span class="hljs-number">0</span>, hours=<span class="hljs-number">0</span>, minutes=<span class="hljs-number">0</span>, seconds=<span class="hljs-number">0</span>, ...)
531+
<div><h3 id="constructors">Constructors</h3><pre><code class="python language-python apache hljs">&lt;D&gt; = date(year, month, day) <span class="hljs-comment"># Only accepts valid dates from 1 to 9999 AD.</span>
532+
&lt;T&gt; = time(hour=<span class="hljs-number">0</span>, minute=<span class="hljs-number">0</span>, second=<span class="hljs-number">0</span>) <span class="hljs-comment"># Also: `microsecond=0, tzinfo=None, fold=0`.</span>
533+
&lt;DT&gt; = datetime(year, month, day, hour=<span class="hljs-number">0</span>) <span class="hljs-comment"># Also: `minute=0, second=0, microsecond=0, …`.</span>
534+
&lt;TD&gt; = timedelta(weeks=<span class="hljs-number">0</span>, days=<span class="hljs-number">0</span>, hours=<span class="hljs-number">0</span>) <span class="hljs-comment"># Also: `minutes=0, seconds=0, microsecond=0`.</span>
535535
</code></pre></div>
536536

537537
<ul>
@@ -565,7 +565,7 @@
565565
<li><strong>ISO strings come in following forms: <code class="python hljs"><span class="hljs-string">'YYYY-MM-DD'</span></code>, <code class="python hljs"><span class="hljs-string">'HH:MM:SS.mmmuuu[±HH:MM]'</span></code>, or both separated by an arbitrary character. All parts following hours are optional.</strong></li>
566566
<li><strong>Python uses the Unix Epoch: <code class="python hljs"><span class="hljs-string">'1970-01-01 00:00 UTC'</span></code>, <code class="python hljs"><span class="hljs-string">'1970-01-01 01:00 CET'</span></code>, …</strong></li>
567567
</ul>
568-
<div><h3 id="decode">Decode</h3><pre><code class="python language-python hljs">&lt;str&gt; = &lt;D/T/DT&gt;.isoformat(sep=<span class="hljs-string">'T'</span>) <span class="hljs-comment"># Also timespec='auto/hours/minutes/seconds/…'.</span>
568+
<div><h3 id="decode">Decode</h3><pre><code class="python language-python hljs">&lt;str&gt; = &lt;D/T/DT&gt;.isoformat(sep=<span class="hljs-string">'T'</span>) <span class="hljs-comment"># Also: `timespec='auto/hours/minutes/seconds/…'`.</span>
569569
&lt;str&gt; = &lt;D/T/DT&gt;.strftime(<span class="hljs-string">'&lt;format&gt;'</span>) <span class="hljs-comment"># Custom string representation.</span>
570570
&lt;int&gt; = &lt;D/DT&gt;.toordinal() <span class="hljs-comment"># Days since Gregorian NYE 1, ignoring time and tz.</span>
571571
&lt;float&gt; = &lt;DTn&gt;.timestamp() <span class="hljs-comment"># Seconds since the Epoch, from DTn in local tz.</span>
@@ -2274,11 +2274,11 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
22742274
</code></pre></div>
22752275

22762276
<pre><code class="python language-python hljs">&lt;ImageDraw&gt;.point((x, y)) <span class="hljs-comment"># Truncates floats into ints.</span>
2277-
&lt;ImageDraw&gt;.line((x1, y1, x2, y2 [, ...])) <span class="hljs-comment"># To get anti-aliasing use images's resize().</span>
2277+
&lt;ImageDraw&gt;.line((x1, y1, x2, y2 [, ...])) <span class="hljs-comment"># To get anti-aliasing use Image's resize().</span>
22782278
&lt;ImageDraw&gt;.arc((x1, y1, x2, y2), deg1, deg2) <span class="hljs-comment"># Always draws in clockwise direction.</span>
2279-
&lt;ImageDraw&gt;.rectangle((x1, y1, x2, y2)) <span class="hljs-comment"># To rotate use image's rotate() and paste().</span>
2280-
&lt;ImageDraw&gt;.polygon((x1, y1, x2, y2, ...)) <span class="hljs-comment"># Last and first point get connected.</span>
2281-
&lt;ImageDraw&gt;.ellipse((x1, y1, x2, y2)) <span class="hljs-comment"># To rotate use image's rotate() and paste().</span>
2279+
&lt;ImageDraw&gt;.rectangle((x1, y1, x2, y2)) <span class="hljs-comment"># To rotate use Image's rotate() and paste().</span>
2280+
&lt;ImageDraw&gt;.polygon((x1, y1, x2, y2, ...)) <span class="hljs-comment"># Last point gets connected to the first.</span>
2281+
&lt;ImageDraw&gt;.ellipse((x1, y1, x2, y2)) <span class="hljs-comment"># To rotate use Image's rotate() and paste().</span>
22822282
</code></pre>
22832283
<ul>
22842284
<li><strong>Use <code class="python hljs"><span class="hljs-string">'fill=&lt;color&gt;'</span></code> to set the primary color.</strong></li>
@@ -2905,7 +2905,7 @@ <h3 id="format-2">Format</h3><div><h4 id="forstandardtypesizesandmanualalignment
29052905

29062906

29072907
<footer>
2908-
<aside>July 24, 2022</aside>
2908+
<aside>July 25, 2022</aside>
29092909
<a href="https://gto76.github.io" rel="author">Jure Šorn</a>
29102910
</footer>
29112911

0 commit comments

Comments
 (0)