×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    14

    How to convert to posix time

    I wish to know if it's possible to make unix time only from the following data:
    Year
    Month
    Date
    Hour
    Minute
    Seconds

    If yes how ?
    Plz note i wish to define my own variables for year ,month ,date ,etc.

    If no , how to make my own time tuple using above information and some info from existing variables through time module .

    Thanx in advance,
    Br,
    Aloycasmir

  2. #2
    Nokia Developer Expert
    Join Date
    Apr 2007
    Posts
    131

    Re: How to convert to posix time

    It is possible. What you need to use is the 'datetime' module.

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    14
    Mahesh , thanx for replying .

    i'm aware that we can do it by using datetime module's datetime tuple .
    But i wish to know how to make posix time with only information on 'year , month , date , hour , minute , second'
    And all other info being unawailable .

    How would i make unix with only those variables .
    The situation is that I'm unaware of remaining variables .
    Eg-
    For now:
    '2009 , 06 , 03 , 12 , 05 , 39' is data available .
    How to get this into unix time .
    If possible plz also give some samples wrt to the above info

    Br,
    Aloycasmir

  4. #4
    Nokia Developer Expert
    Join Date
    Apr 2007
    Posts
    131

    Re: How to convert to posix time

    Quote Originally Posted by aloycasmir View Post
    For now:
    '2009 , 06 , 03 , 12 , 05 , 39' is data available .
    How to get this into unix time .
    If possible plz also give some samples wrt to the above info
    Code:
    import time
    time.mktime((2009, 6, 3, 12, 5, 39, 0, 0, 0))

  5. #5
    Registered User
    Join Date
    Dec 2008
    Posts
    14
    Oh . Just that ?
    That's simple .
    Nonetheless , thanx a ton mahesh bro .

    Btw Is that accurate sufficiently ?
    To the minute level to current time ?

  6. #6
    Nokia Developer Expert
    Join Date
    Apr 2007
    Posts
    131

    Re: How to convert to posix time

    Quote Originally Posted by aloycasmir View Post
    Btw Is that accurate sufficiently ?
    To the minute level to current time ?
    This is upto the seconds, (2009, 6, 3, 12, 5, 39) => 3:Jun:009 12H:5M:39S

Similar Threads

  1. Replies: 0
    Last Post: 2008-01-03, 17:58

Posting Permissions

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