×

Discussion Board

Results 1 to 4 of 4
  1. #1
    Registered User
    Join Date
    Oct 2008
    Posts
    29

    current date? today's date?

    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.

  2. #2
    Nokia Developer Moderator
    Join Date
    Oct 2007
    Location
    Deva, Romania
    Posts
    3,471

    Re: current date? today's date?

    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

  3. #3
    Super Contributor
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744

    Re: current date? today's date?

    Quote Originally Posted by mango7 View Post
    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.

    You may also want to see this article.


    Hope it helps,

    Rafael.

  4. #4
    Registered User
    Join Date
    Oct 2008
    Posts
    29

    Re: current date? today's date?

    Thanks, I got it!

Similar Threads

  1. Error in packaging process :(
    By a-eqla3 in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 1
    Last Post: 2008-07-24, 20:33
  2. Getting current date and time
    By Deepa msc in forum Mobile Java General
    Replies: 6
    Last Post: 2008-06-25, 10:08

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •