fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

8.6K
active users

#datetimestamp

0 posts0 participants0 posts today
Alexandre B A Villares 🐍<p>Hoje eu aprendi a converter um <a href="https://ciberlandia.pt/tags/datetimestamp" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>datetimestamp</span></a> unix em uma data legível com <a href="https://ciberlandia.pt/tags/Python" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>Python</span></a> <a href="https://ciberlandia.pt/tags/datetime" class="mention hashtag" rel="nofollow noopener" target="_blank">#<span>datetime</span></a> </p><pre><code>from datetime import datetime<br>ts = int('1284101485')<br><br># if you encounter a "year is out of range" error the timestamp<br># may be in milliseconds, try `ts /= 1000` in that case<br>print(datetime.utcfromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S'))<br></code></pre><p><a href="https://stackoverflow.com/a/3682808/19771" rel="nofollow noopener" translate="no" target="_blank"><span class="invisible">https://</span><span class="ellipsis">stackoverflow.com/a/3682808/19</span><span class="invisible">771</span></a></p>