Module time

This module provides various methods of describing time other than in terms of seconds, such as 6y5w4d3h2m1s to describe 6 years, 5 weeks, 4 days, 3 hours, 2 minutes and one second. This can be used for making user input simplyer, as 6y is far more user friendly than 189341556.

Constants:

  • YEAR: Used to specify years in unit conversions
  • WEEK: Used to specify weeks in unit conversions
  • DAY: Used to specify days in unit conversions
  • HOUR: Used to specify hours in unit conversions
  • MINUTE: Used to specify minutes in unit conversions

Release: Version 1.0 Preemtive Release

Functions

SecondsToTimestring (time) Converts a time into a timestring
SecondsToUnit (time, unit) Converts a time in seconds into units
TimestringToSeconds (str) Converts a timestring into seconds
UnitToSeconds (time, unit) Converts time of one unit to seconds


Functions

SecondsToTimestring (time)
Converts a time into a timestring

Parameters

  • time: The time in seconds

Return value:

A human readable timestring
SecondsToUnit (time, unit)
Converts a time in seconds into units

Parameters

  • time: The time
  • unit: The unit to convert the time to

Return value:

The time in the unit specified
TimestringToSeconds (str)
Converts a timestring into seconds

Parameters

  • str: The timestring to converty

Return value:

The specified time
UnitToSeconds (time, unit)
Converts time of one unit to seconds

Parameters

  • time: The time
  • unit: The unit the time is in

Return value:

The time in seconds

Valid XHTML 1.0!