<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"
	>
<channel>
	<title>Comments on: datetime to string, easy; string to datetime&#8230; oh my, my!</title>
	<atom:link href="http://aralbalkan.com/1512/feed" rel="self" type="application/rss+xml" />
	<link>http://aralbalkan.com/1512</link>
	<description>Passionate geekisms.</description>
	<lastBuildDate>Sun, 12 Feb 2012 17:52:56 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: sheshakiran</title>
		<link>http://aralbalkan.com/1512/comment-page-1#comment-262324</link>
		<dc:creator>sheshakiran</dc:creator>
		<pubDate>Fri, 08 Apr 2011 10:05:27 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/1512#comment-262324</guid>
		<description>how to convert string to date format
eg :
2011-04-08(think this is string and shuld convert it into date format )</description>
		<content:encoded><![CDATA[<p>how to convert string to date format<br />
eg :<br />
2011-04-08(think this is string and shuld convert it into date format )</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Caio</title>
		<link>http://aralbalkan.com/1512/comment-page-1#comment-260452</link>
		<dc:creator>Caio</dc:creator>
		<pubDate>Tue, 08 Jun 2010 22:21:37 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/1512#comment-260452</guid>
		<description>You can also use datetime.strptime(&quot;date&quot;,&quot;format&quot;) to convert string to datetime. 

Note that the datetime.strptime returns a datetime object, if you want a datetime.date object you should call datetime.strptime(&quot;date&quot;,&quot;format&quot;).date().

I think it&#039;s simpler.
Regards!</description>
		<content:encoded><![CDATA[<p>You can also use datetime.strptime(&#8220;date&#8221;,&#8221;format&#8221;) to convert string to datetime. </p>
<p>Note that the datetime.strptime returns a datetime object, if you want a datetime.date object you should call datetime.strptime(&#8220;date&#8221;,&#8221;format&#8221;).date().</p>
<p>I think it&#8217;s simpler.<br />
Regards!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Himanshu</title>
		<link>http://aralbalkan.com/1512/comment-page-1#comment-260402</link>
		<dc:creator>Himanshu</dc:creator>
		<pubDate>Tue, 01 Jun 2010 10:32:36 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/1512#comment-260402</guid>
		<description>I came across this:
http://mail.python.org/pipermail/tutor/2006-March/045729.html

Code at this like has one error though, in last line instead of mytime it should be timestring</description>
		<content:encoded><![CDATA[<p>I came across this:<br />
<a href="http://mail.python.org/pipermail/tutor/2006-March/045729.html" rel="nofollow">http://mail.python.org/pipermail/tutor/2006-March/045729.html</a></p>
<p>Code at this like has one error though, in last line instead of mytime it should be timestring</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: markvan</title>
		<link>http://aralbalkan.com/1512/comment-page-1#comment-260244</link>
		<dc:creator>markvan</dc:creator>
		<pubDate>Thu, 20 May 2010 12:20:38 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/1512#comment-260244</guid>
		<description>Datatype conversion heaven, this just made sense and worked.
I remember your skill from the Flash5 days and Flashkit, good to know you are still caring and sharing.</description>
		<content:encoded><![CDATA[<p>Datatype conversion heaven, this just made sense and worked.<br />
I remember your skill from the Flash5 days and Flashkit, good to know you are still caring and sharing.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Shubhadeep</title>
		<link>http://aralbalkan.com/1512/comment-page-1#comment-256192</link>
		<dc:creator>Shubhadeep</dc:creator>
		<pubDate>Sat, 13 Jun 2009 07:03:37 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/1512#comment-256192</guid>
		<description>Thanks Man!
You saved me a lot of time

Thanks again</description>
		<content:encoded><![CDATA[<p>Thanks Man!<br />
You saved me a lot of time</p>
<p>Thanks again</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://aralbalkan.com/1512/comment-page-1#comment-213501</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 05 Feb 2009 05:37:55 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/1512#comment-213501</guid>
		<description>sorry, tried 3 times to post with indenting -- as we all know, in python, whitespace counts!

If you can&#039;t determine the proper indentation and you actually want the code, let me know by email: 

davydm _AT_ gmail _DOT_ com

Sorry for the comment spam!</description>
		<content:encoded><![CDATA[<p>sorry, tried 3 times to post with indenting &#8212; as we all know, in python, whitespace counts!</p>
<p>If you can&#8217;t determine the proper indentation and you actually want the code, let me know by email: </p>
<p>davydm _AT_ gmail _DOT_ com</p>
<p>Sorry for the comment spam!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://aralbalkan.com/1512/comment-page-1#comment-213498</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 05 Feb 2009 05:35:28 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/1512#comment-213498</guid>
		<description>&lt;code&gt;
import datetime
import sys
import os

# much fudgery
def utctime(dt):
  return (((dt.toordinal()-719163)*24+dt.hour)*60+dt.minute)*60+dt.second

def try_formats():
  ret = []
  ret.append(&quot;%Y-%m-%d&quot;)
  ret.append(&quot;%Y/%m/%d&quot;)
  ret.append(&quot;%d/%m/%Y&quot;)
  ret.append(&quot;%d-%m-%Y&quot;)
  ret.append(&quot;%d/%m/%y&quot;)
  ret.append(&quot;%d-%m-%y&quot;)
  ret.append(&quot;%Y-%m-%d %H:%M:%S&quot;)
  ret.append(&quot;%d-%m-%Y %H:%M:%S&quot;)
  ret.append(&quot;%Y/%m/%d %H:%M:%S&quot;)
  ret.append(&quot;%d/%m/%Y %H:%M:%S&quot;)
  ret.append(&quot;%d-%m-%y %H:%M:%S&quot;)
  ret.append(&quot;%y/%m/%d %H:%M:%S&quot;)
  ret.append(&quot;%d/%m/%y %H:%M:%S&quot;)
  ret.append(&quot;%Y-%m-%d %H:%M&quot;)
  ret.append(&quot;%d-%m-%Y %H:%M&quot;)
  ret.append(&quot;%Y/%m/%d %H:%M&quot;)
  ret.append(&quot;%d/%m/%Y %H:%M&quot;)
  ret.append(&quot;%d-%m-%y %H:%M&quot;)
  ret.append(&quot;%y/%m/%d %H:%M&quot;)
  ret.append(&quot;%d/%m/%y %H:%M&quot;)
  return ret


def show_date(s):
  FORMAT=&quot;%Y-%m-%d %H:%M:%S&quot;
  try:
    secs = int(s)
    d = datetime.datetime.fromtimestamp(secs)
    print(str(secs) + &quot; :: &quot; + d.strftime(FORMAT))
    return
  except:
    pass

  for f in try_formats():
    try:
      d = datetime.datetime.strptime(s, f)
      secs = utctime(d)
      print(str(secs) + &quot; :: &quot; + d.strftime(FORMAT))
      return
    except:
      pass

  print(&quot;Unable to grok datetime / int string &#039;&quot; + s + &quot;&#039;&quot;)

def usage():
  print(os.path.basename(sys.argv[0]) + &quot;  ...&quot;)
  print(&quot;  attempts to grok the date from the string you provided and&quot;)
  print(&quot;  prints out a timestamp and date string for all arguments&quot;)

if __name__ == &quot;__main__&quot;:
  if len(sys.argv) == 1:
    usage()
  else:
    for arg in sys.argv[1:]:
      if (arg == &quot;--help&quot;) or (arg == &quot;-h&quot;):
        usage()
      else:
        show_date(arg)
&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p><code><br />
import datetime<br />
import sys<br />
import os</p>
<p># much fudgery<br />
def utctime(dt):<br />
  return (((dt.toordinal()-719163)*24+dt.hour)*60+dt.minute)*60+dt.second</p>
<p>def try_formats():<br />
  ret = []<br />
  ret.append("%Y-%m-%d")<br />
  ret.append("%Y/%m/%d")<br />
  ret.append("%d/%m/%Y")<br />
  ret.append("%d-%m-%Y")<br />
  ret.append("%d/%m/%y")<br />
  ret.append("%d-%m-%y")<br />
  ret.append("%Y-%m-%d %H:%M:%S")<br />
  ret.append("%d-%m-%Y %H:%M:%S")<br />
  ret.append("%Y/%m/%d %H:%M:%S")<br />
  ret.append("%d/%m/%Y %H:%M:%S")<br />
  ret.append("%d-%m-%y %H:%M:%S")<br />
  ret.append("%y/%m/%d %H:%M:%S")<br />
  ret.append("%d/%m/%y %H:%M:%S")<br />
  ret.append("%Y-%m-%d %H:%M")<br />
  ret.append("%d-%m-%Y %H:%M")<br />
  ret.append("%Y/%m/%d %H:%M")<br />
  ret.append("%d/%m/%Y %H:%M")<br />
  ret.append("%d-%m-%y %H:%M")<br />
  ret.append("%y/%m/%d %H:%M")<br />
  ret.append("%d/%m/%y %H:%M")<br />
  return ret</p>
<p>def show_date(s):<br />
  FORMAT="%Y-%m-%d %H:%M:%S"<br />
  try:<br />
    secs = int(s)<br />
    d = datetime.datetime.fromtimestamp(secs)<br />
    print(str(secs) + " :: " + d.strftime(FORMAT))<br />
    return<br />
  except:<br />
    pass</p>
<p>  for f in try_formats():<br />
    try:<br />
      d = datetime.datetime.strptime(s, f)<br />
      secs = utctime(d)<br />
      print(str(secs) + " :: " + d.strftime(FORMAT))<br />
      return<br />
    except:<br />
      pass</p>
<p>  print("Unable to grok datetime / int string '" + s + "'")</p>
<p>def usage():<br />
  print(os.path.basename(sys.argv[0]) + "  ...")<br />
  print("  attempts to grok the date from the string you provided and")<br />
  print("  prints out a timestamp and date string for all arguments")</p>
<p>if __name__ == "__main__":<br />
  if len(sys.argv) == 1:<br />
    usage()<br />
  else:<br />
    for arg in sys.argv[1:]:<br />
      if (arg == "--help") or (arg == "-h"):<br />
        usage()<br />
      else:<br />
        show_date(arg)<br />
</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://aralbalkan.com/1512/comment-page-1#comment-213497</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 05 Feb 2009 05:34:55 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/1512#comment-213497</guid>
		<description>
import datetime
import sys
import os

# much fudgery
def utctime(dt):
  return (((dt.toordinal()-719163)*24+dt.hour)*60+dt.minute)*60+dt.second

def try_formats():
  ret = []
  ret.append(&quot;%Y-%m-%d&quot;)
  ret.append(&quot;%Y/%m/%d&quot;)
  ret.append(&quot;%d/%m/%Y&quot;)
  ret.append(&quot;%d-%m-%Y&quot;)
  ret.append(&quot;%d/%m/%y&quot;)
  ret.append(&quot;%d-%m-%y&quot;)
  ret.append(&quot;%Y-%m-%d %H:%M:%S&quot;)
  ret.append(&quot;%d-%m-%Y %H:%M:%S&quot;)
  ret.append(&quot;%Y/%m/%d %H:%M:%S&quot;)
  ret.append(&quot;%d/%m/%Y %H:%M:%S&quot;)
  ret.append(&quot;%d-%m-%y %H:%M:%S&quot;)
  ret.append(&quot;%y/%m/%d %H:%M:%S&quot;)
  ret.append(&quot;%d/%m/%y %H:%M:%S&quot;)
  ret.append(&quot;%Y-%m-%d %H:%M&quot;)
  ret.append(&quot;%d-%m-%Y %H:%M&quot;)
  ret.append(&quot;%Y/%m/%d %H:%M&quot;)
  ret.append(&quot;%d/%m/%Y %H:%M&quot;)
  ret.append(&quot;%d-%m-%y %H:%M&quot;)
  ret.append(&quot;%y/%m/%d %H:%M&quot;)
  ret.append(&quot;%d/%m/%y %H:%M&quot;)
  return ret


def show_date(s):
  FORMAT=&quot;%Y-%m-%d %H:%M:%S&quot;
  try:
    secs = int(s)
    d = datetime.datetime.fromtimestamp(secs)
    print(str(secs) + &quot; :: &quot; + d.strftime(FORMAT))
    return
  except:
    pass

  for f in try_formats():
    try:
      d = datetime.datetime.strptime(s, f)
      secs = utctime(d)
      print(str(secs) + &quot; :: &quot; + d.strftime(FORMAT))
      return
    except:
      pass

  print(&quot;Unable to grok datetime / int string &#039;&quot; + s + &quot;&#039;&quot;)

def usage():
  print(os.path.basename(sys.argv[0]) + &quot;  ...&quot;)
  print(&quot;  attempts to grok the date from the string you provided and&quot;)
  print(&quot;  prints out a timestamp and date string for all arguments&quot;)

if __name__ == &quot;__main__&quot;:
  if len(sys.argv) == 1:
    usage()
  else:
    for arg in sys.argv[1:]:
      if (arg == &quot;--help&quot;) or (arg == &quot;-h&quot;):
        usage()
      else:
        show_date(arg)
</description>
		<content:encoded><![CDATA[<p>import datetime<br />
import sys<br />
import os</p>
<p># much fudgery<br />
def utctime(dt):<br />
  return (((dt.toordinal()-719163)*24+dt.hour)*60+dt.minute)*60+dt.second</p>
<p>def try_formats():<br />
  ret = []<br />
  ret.append(&#8220;%Y-%m-%d&#8221;)<br />
  ret.append(&#8220;%Y/%m/%d&#8221;)<br />
  ret.append(&#8220;%d/%m/%Y&#8221;)<br />
  ret.append(&#8220;%d-%m-%Y&#8221;)<br />
  ret.append(&#8220;%d/%m/%y&#8221;)<br />
  ret.append(&#8220;%d-%m-%y&#8221;)<br />
  ret.append(&#8220;%Y-%m-%d %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%d-%m-%Y %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%Y/%m/%d %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%d/%m/%Y %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%d-%m-%y %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%y/%m/%d %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%d/%m/%y %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%Y-%m-%d %H:%M&#8221;)<br />
  ret.append(&#8220;%d-%m-%Y %H:%M&#8221;)<br />
  ret.append(&#8220;%Y/%m/%d %H:%M&#8221;)<br />
  ret.append(&#8220;%d/%m/%Y %H:%M&#8221;)<br />
  ret.append(&#8220;%d-%m-%y %H:%M&#8221;)<br />
  ret.append(&#8220;%y/%m/%d %H:%M&#8221;)<br />
  ret.append(&#8220;%d/%m/%y %H:%M&#8221;)<br />
  return ret</p>
<p>def show_date(s):<br />
  FORMAT=&#8221;%Y-%m-%d %H:%M:%S&#8221;<br />
  try:<br />
    secs = int(s)<br />
    d = datetime.datetime.fromtimestamp(secs)<br />
    print(str(secs) + &#8221; :: &#8221; + d.strftime(FORMAT))<br />
    return<br />
  except:<br />
    pass</p>
<p>  for f in try_formats():<br />
    try:<br />
      d = datetime.datetime.strptime(s, f)<br />
      secs = utctime(d)<br />
      print(str(secs) + &#8221; :: &#8221; + d.strftime(FORMAT))<br />
      return<br />
    except:<br />
      pass</p>
<p>  print(&#8220;Unable to grok datetime / int string &#8216;&#8221; + s + &#8220;&#8216;&#8221;)</p>
<p>def usage():<br />
  print(os.path.basename(sys.argv[0]) + &#8221;  &#8230;&#8221;)<br />
  print(&#8221;  attempts to grok the date from the string you provided and&#8221;)<br />
  print(&#8221;  prints out a timestamp and date string for all arguments&#8221;)</p>
<p>if __name__ == &#8220;__main__&#8221;:<br />
  if len(sys.argv) == 1:<br />
    usage()<br />
  else:<br />
    for arg in sys.argv[1:]:<br />
      if (arg == &#8220;&#8211;help&#8221;) or (arg == &#8220;-h&#8221;):<br />
        usage()<br />
      else:<br />
        show_date(arg)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Dave</title>
		<link>http://aralbalkan.com/1512/comment-page-1#comment-213496</link>
		<dc:creator>Dave</dc:creator>
		<pubDate>Thu, 05 Feb 2009 05:34:20 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/1512#comment-213496</guid>
		<description>There&#039;s a cheaper (as in &quot;cheap-n-nasty&quot;), more easily extensible method

The following code converts a timestamp or date string to a date object and prints it out (I needed to be able to do this for an arb reason):


#begin code
import datetime
import sys
import os

# much fudgery
def utctime(dt):
  return (((dt.toordinal()-719163)*24+dt.hour)*60+dt.minute)*60+dt.second

def try_formats():
  ret = []
  ret.append(&quot;%Y-%m-%d&quot;)
  ret.append(&quot;%Y/%m/%d&quot;)
  ret.append(&quot;%d/%m/%Y&quot;)
  ret.append(&quot;%d-%m-%Y&quot;)
  ret.append(&quot;%d/%m/%y&quot;)
  ret.append(&quot;%d-%m-%y&quot;)
  ret.append(&quot;%Y-%m-%d %H:%M:%S&quot;)
  ret.append(&quot;%d-%m-%Y %H:%M:%S&quot;)
  ret.append(&quot;%Y/%m/%d %H:%M:%S&quot;)
  ret.append(&quot;%d/%m/%Y %H:%M:%S&quot;)
  ret.append(&quot;%d-%m-%y %H:%M:%S&quot;)
  ret.append(&quot;%y/%m/%d %H:%M:%S&quot;)
  ret.append(&quot;%d/%m/%y %H:%M:%S&quot;)
  ret.append(&quot;%Y-%m-%d %H:%M&quot;)
  ret.append(&quot;%d-%m-%Y %H:%M&quot;)
  ret.append(&quot;%Y/%m/%d %H:%M&quot;)
  ret.append(&quot;%d/%m/%Y %H:%M&quot;)
  ret.append(&quot;%d-%m-%y %H:%M&quot;)
  ret.append(&quot;%y/%m/%d %H:%M&quot;)
  ret.append(&quot;%d/%m/%y %H:%M&quot;)
  return ret


def show_date(s):
  FORMAT=&quot;%Y-%m-%d %H:%M:%S&quot;
  try:
    secs = int(s)
    d = datetime.datetime.fromtimestamp(secs)
    print(str(secs) + &quot; :: &quot; + d.strftime(FORMAT))
    return
  except:
    pass

  for f in try_formats():
    try:
      d = datetime.datetime.strptime(s, f)
      secs = utctime(d)
      print(str(secs) + &quot; :: &quot; + d.strftime(FORMAT))
      return
    except:
      pass

  print(&quot;Unable to grok datetime / int string &#039;&quot; + s + &quot;&#039;&quot;)

def usage():
  print(os.path.basename(sys.argv[0]) + &quot;  ...&quot;)
  print(&quot;  attempts to grok the date from the string you provided and&quot;)
  print(&quot;  prints out a timestamp and date string for all arguments&quot;)

if __name__ == &quot;__main__&quot;:
  if len(sys.argv) == 1:
    usage()
  else:
    for arg in sys.argv[1:]:
      if (arg == &quot;--help&quot;) or (arg == &quot;-h&quot;):
        usage()
      else:
        show_date(arg)

#end code

Hope it helps someone.</description>
		<content:encoded><![CDATA[<p>There&#8217;s a cheaper (as in &#8220;cheap-n-nasty&#8221;), more easily extensible method</p>
<p>The following code converts a timestamp or date string to a date object and prints it out (I needed to be able to do this for an arb reason):</p>
<p>#begin code<br />
import datetime<br />
import sys<br />
import os</p>
<p># much fudgery<br />
def utctime(dt):<br />
  return (((dt.toordinal()-719163)*24+dt.hour)*60+dt.minute)*60+dt.second</p>
<p>def try_formats():<br />
  ret = []<br />
  ret.append(&#8220;%Y-%m-%d&#8221;)<br />
  ret.append(&#8220;%Y/%m/%d&#8221;)<br />
  ret.append(&#8220;%d/%m/%Y&#8221;)<br />
  ret.append(&#8220;%d-%m-%Y&#8221;)<br />
  ret.append(&#8220;%d/%m/%y&#8221;)<br />
  ret.append(&#8220;%d-%m-%y&#8221;)<br />
  ret.append(&#8220;%Y-%m-%d %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%d-%m-%Y %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%Y/%m/%d %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%d/%m/%Y %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%d-%m-%y %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%y/%m/%d %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%d/%m/%y %H:%M:%S&#8221;)<br />
  ret.append(&#8220;%Y-%m-%d %H:%M&#8221;)<br />
  ret.append(&#8220;%d-%m-%Y %H:%M&#8221;)<br />
  ret.append(&#8220;%Y/%m/%d %H:%M&#8221;)<br />
  ret.append(&#8220;%d/%m/%Y %H:%M&#8221;)<br />
  ret.append(&#8220;%d-%m-%y %H:%M&#8221;)<br />
  ret.append(&#8220;%y/%m/%d %H:%M&#8221;)<br />
  ret.append(&#8220;%d/%m/%y %H:%M&#8221;)<br />
  return ret</p>
<p>def show_date(s):<br />
  FORMAT=&#8221;%Y-%m-%d %H:%M:%S&#8221;<br />
  try:<br />
    secs = int(s)<br />
    d = datetime.datetime.fromtimestamp(secs)<br />
    print(str(secs) + &#8221; :: &#8221; + d.strftime(FORMAT))<br />
    return<br />
  except:<br />
    pass</p>
<p>  for f in try_formats():<br />
    try:<br />
      d = datetime.datetime.strptime(s, f)<br />
      secs = utctime(d)<br />
      print(str(secs) + &#8221; :: &#8221; + d.strftime(FORMAT))<br />
      return<br />
    except:<br />
      pass</p>
<p>  print(&#8220;Unable to grok datetime / int string &#8216;&#8221; + s + &#8220;&#8216;&#8221;)</p>
<p>def usage():<br />
  print(os.path.basename(sys.argv[0]) + &#8221;  &#8230;&#8221;)<br />
  print(&#8221;  attempts to grok the date from the string you provided and&#8221;)<br />
  print(&#8221;  prints out a timestamp and date string for all arguments&#8221;)</p>
<p>if __name__ == &#8220;__main__&#8221;:<br />
  if len(sys.argv) == 1:<br />
    usage()<br />
  else:<br />
    for arg in sys.argv[1:]:<br />
      if (arg == &#8220;&#8211;help&#8221;) or (arg == &#8220;-h&#8221;):<br />
        usage()<br />
      else:<br />
        show_date(arg)</p>
<p>#end code</p>
<p>Hope it helps someone.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: OzgurBatu</title>
		<link>http://aralbalkan.com/1512/comment-page-1#comment-190583</link>
		<dc:creator>OzgurBatu</dc:creator>
		<pubDate>Wed, 15 Oct 2008 19:54:57 +0000</pubDate>
		<guid isPermaLink="false">http://aralbalkan.com/1512#comment-190583</guid>
		<description>it realy works. Thank you...</description>
		<content:encoded><![CDATA[<p>it realy works. Thank you&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>

