OSDN Git Service
(root)
/
gwit
/
gwit.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
34719b7
)
bug fix: -1 day ago if local clock delayed
author
Hirotaka Kawata
<hktechno@hotmail.com>
Mon, 8 Mar 2010 16:55:26 +0000
(
01:55
+0900)
committer
Hirotaka Kawata
<hktechno@hotmail.com>
Mon, 8 Mar 2010 16:55:26 +0000
(
01:55
+0900)
twittertools.py
patch
|
blob
|
history
diff --git
a/twittertools.py
b/twittertools.py
index
30bf5a3
..
9a7c15f
100644
(file)
--- a/
twittertools.py
+++ b/
twittertools.py
@@
-83,8
+83,12
@@
class TwitterTools:
return dt.strftime("%H:%M:%S")
def get_time_ago(self, dt):
- ago = datetime.datetime.now() - dt
+ now = datetime.datetime.now()
+
+ if now < dt:
+ return "Just now!"
+ ago = now - dt
hours = ago.seconds / 3600
minutes = ago.seconds / 60