From 06f571767e81b43cda32b789b3c9dce82a8cdf4b Mon Sep 17 00:00:00 2001 From: Anna Date: Thu, 8 Apr 2010 01:17:21 -0400 Subject: [PATCH] Started working on formatting the post timestamps --- mytwitter.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/mytwitter.py b/mytwitter.py index 6caa2dc..63d1b79 100755 --- a/mytwitter.py +++ b/mytwitter.py @@ -2,7 +2,7 @@ # # Custom twitter client... mostly for learning Python -import sys, twitter, Tkinter, Pmw, ConfigParser, os, tkMessageBox +import sys, twitter, Tkinter, Pmw, ConfigParser, os, tkMessageBox, datetime class TwitWindow: @@ -84,6 +84,12 @@ class TwitWindow: if i < len(statuses): # Update the label with the user's name and screen name user = statuses[i].user + +# fixme: need to find a way to detect local timezone and print in that +# Also need to decide how to format the output... maybe use a config var? +# timestamp = datetime.datetime.strptime(statuses[i].created_at, "%a %b %d %H:%M:%S %z %Y") +# timestring = timestamp.strftime() + labeltext = user.name + " (" + user.screen_name + ") " + statuses[i].created_at self.labels[i].config(text=labeltext)