| Reply | « Previous Thread | Next Thread » |
|
Hi,
Does anyone know how to retrieve the current day/ today's date in python? I am would like to set the default expiration date in my form to today's date (or several days from now). Thanks in advance. |
|
Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
Offline
Forum Nokia Champion
|
|
You could use the functions in the time module to manipulate times and dates.
A simple example for retrieving the current date and time: Code:
>>> import time >>> print time.localtime() (2008, 10, 27, 17, 49, 58, 0, 301, 0) #The current date is the first three elements in the tuple |
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Rafael T.
Offline
Forum Nokia Champion
|
|
|
Quote:
You may also want to see this article. Hope it helps, Rafael. |
|
Thanks, I got it!
|
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Cannot create sis package? | gomcoite | Themes/Carbide.ui | 4 | 2008-09-27 18:54 |
| Error in packaging process :( | a-eqla3 | Themes/Carbide.ui | 2 | 2008-07-30 23:03 |
| Error in packaging process :( | a-eqla3 | Carbide.c++ IDE and plug-ins | 1 | 2008-07-24 21:33 |
| Getting current date and time | Deepa msc | Mobile Java General | 6 | 2008-06-25 11:08 |
| ERROR IN CREATING THEME | ssmantri | Themes/Carbide.ui | 5 | 2008-05-29 21:58 |