ROS Code
 All Classes Namespaces Files Functions Variables
ros.time Namespace Reference

Functions

def dayofweek
 
def leapyear
 
def closeyear
 
def converttime
 
def minyear
 
def maxyear
 
def timezone
 
def timesince
 
def getdatetime
 
def timeit
 

Detailed Description

All commands based around time functions

Function Documentation

def ros.time.closeyear (   year)
Find how many years away was the closest leap year to a specific year

Definition at line 59 of file time.py.

def ros.time.converttime (   time,
  currentformat,
  newformat 
)
Convert a specific time format to another type

time:
The time to convert

currentformat:
The current format of the time.
Can be seconds, milliseconds, minutes, hours, days, weeks, fortnights, years, decades, centuaries or millenniums.

newformat:
The new format of the time.
Can be seconds, milliseconds, minutes, hours, days, weeks, fortnights, years, decades, centuaries or millenniums.

Definition at line 68 of file time.py.

def ros.time.dayofweek (   day,
  month,
  year,
  formatresult = True 
)
Get the day of the week for a specific day

day:
The day to include in the search

month:
The month to include in the search

year:
The year to include in the search

formatresult:
Whether or not to format the result.
A formatted date would look like: "Monday".
A non formatted date would look like: 1.
Default is True.

Definition at line 11 of file time.py.

def ros.time.getdatetime (   timedateformat = 'complete')
Get the current date or time in a specific format

timedateformat:
The type of date to query for.
Can be day, month, year, hour, minute, second, millisecond, yearmonthday, daymonthyear, hourminutesecond, secondminutehour, complete, datetime or timedate.
Default is "complete".

Definition at line 333 of file time.py.

def ros.time.leapyear (   year)
Check if a year in particular is a leap year

year:
The year to check for

Definition at line 47 of file time.py.

def ros.time.maxyear ( )
Get the maxiumum year allowed by the current OS.

Definition at line 306 of file time.py.

def ros.time.minyear ( )
Get the minimum year allowed by the current OS.

Definition at line 297 of file time.py.

def ros.time.timeit (   command,
  round = True 
)
Time how long a command takes to execute

command:
The command to time.

round:
Whether or not to round the number to an integer. Default is True.

Definition at line 387 of file time.py.

def ros.time.timesince ( )
Get the amount of time since 00:00 on 1 January 1970, the raw date before formatting by computers.

Definition at line 324 of file time.py.

def ros.time.timezone ( )
Get the current timezone code.

Definition at line 315 of file time.py.