<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Tim's Weblog &#187; date</title>
	<atom:link href="http://blog.hokkertjes.nl/tag/date/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.hokkertjes.nl</link>
	<description>Random Thoughts and Rants</description>
	<lastBuildDate>Fri, 23 Jul 2010 11:41:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Isoformat in Python 2.4</title>
		<link>http://blog.hokkertjes.nl/2008/03/24/isoformat-in-python-24/</link>
		<comments>http://blog.hokkertjes.nl/2008/03/24/isoformat-in-python-24/#comments</comments>
		<pubDate>Mon, 24 Mar 2008 14:41:00 +0000</pubDate>
		<dc:creator>Tim</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[date]]></category>
		<category><![CDATA[isoformat]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://blog.hokkertjes.nl/2008/03/24/isoformat-in-python-24/</guid>
		<description><![CDATA[Sometimes I don&#8217;t like python. Just sometimes, I love it most of the times. But just look what hoops I need to jump through to get a current timestamp in ISO format: from datetime import datetime, tzinfo, timedelta import time class TZ(tzinfo): def utcoffset(self,dt): return timedelta(seconds=time.timezone) def dst(self,dt): return timedelta(0) a = datetime.now(TZ()) a= a.replace(microsecond [...]]]></description>
			<content:encoded><![CDATA[<p>Sometimes I don&#8217;t like python. Just sometimes, I love it most of the times. But just look what hoops I need to jump through to get a current timestamp in ISO format:</p>
<pre>from datetime import datetime, tzinfo, timedelta
import time

class TZ(tzinfo):
        def utcoffset(self,dt): return timedelta(seconds=time.timezone)
        def dst(self,dt): return timedelta(0)

a = datetime.now(TZ())
a= a.replace(microsecond = 0)
print a.isoformat()
</pre>
<p>That prints:</p>
<p><code>asterisk:~ tim$ python test.py<br />
2008-03-24T13:38:06-01:00</code></p>
<p>Fugly&#8230;</p>

<!-- start wp-tags-to-technorati 1.02 -->

<p class='technorati-tags'>Tags: <a class='technorati-link' href='http://technorati.com/tag/code' rel='tag' target='_self'>code</a>, <a class='technorati-link' href='http://technorati.com/tag/date' rel='tag' target='_self'>date</a>, <a class='technorati-link' href='http://technorati.com/tag/isoformat' rel='tag' target='_self'>isoformat</a>, <a class='technorati-link' href='http://technorati.com/tag/python' rel='tag' target='_self'>python</a>, <a class='technorati-link' href='http://technorati.com/tag/time' rel='tag' target='_self'>time</a></p>

<!-- end wp-tags-to-technorati -->
]]></content:encoded>
			<wfw:commentRss>http://blog.hokkertjes.nl/2008/03/24/isoformat-in-python-24/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
