A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2005-April/052712.html below:

[Python-Dev] How do you get yesterday from a time object

[Python-Dev] How do you get yesterday from a time object [Python-Dev] How do you get yesterday from a time objectRalph Hilton flinkkettel at yahoo.com
Tue Apr 19 17:34:46 CEST 2005
i'm a beginning python programmer.

I want to get the date for yesterday

nowTime = time.localtime(time.time())
print nowTime.
oneDay = 60*60*24 # number seconds in a day
yday = nowTime - oneDay  # <-- generates an error
print yday.strftime("%Y-%m-%d")

How can I just get yesterday's day?  It a simple
concept yet it seems to be so hard to figure out.

What i'm worried about is if today is say
June 1, 2023
what is yesterday?   and how do i compute that?

Ralph Hilton


		
__________________________________ 
Do you Yahoo!? 
Plan great trips with Yahoo! Travel: Now over 17,000 guides!
http://travel.yahoo.com/p-travelguide
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4