Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to getting current time in python ?

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 360
    Comment on it

    If you want to getting current time instant from a seconds since the epoch floating-point value into a time-tuple, pass the floating-point value to a function .For example you can see below code.

    #!/siva/bin/python
    import time;
    localtime = time.localtime(time.time())
    print "Local current time :", localtime

    And output will be-

    Local current time : time.struct_time(tm_year=2013, tm_mon=7, 
    tm_mday=17, tm_hour=21, tm_min=26, tm_sec=3, tm_wday=2, tm_yday=198, tm_isdst=0)

    Note- for getting current time we must use import import time module.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: