The time () method returns the number of times the floating-point number is expressed in seconds in UTC.
Note: Although the time is always returned as a floating-point number, not all systems provide more than 1 seconds of precision. Although this function normally returns a non-descending value, it is possible to return a lower value than previously called during the system clock that has returned two calls.
Grammar
The following is the syntax for the time () method:
Parameters
return value
This method returns the time, because the times in seconds represent floating-point numbers (in UTC).
Example
The following example shows the use of the time () method.
#!/usr/bin/pythonimport timeprint "Time.time ():%f"% time.time () print time.localtime (Time.time ()) Print time.asctime ( Time.localtime (Time.time ()))
When we run the above program, it produces the following results:
Time.time (): 1234892919.655932 (2, 1, 2014, 0) Tue 17 10:28:39