Arena  1.0
A content management system
 All Classes Files Functions Variables Pages
Library.String.Utilities.Time Class Reference

A utility class that provides routines to handle time. More...

Public Member Functions

def now
 Return the current local time as the number of seconds since the Unix epoch. More...
 
def gmt
 Return the current GMT time.
 
def zoneOffset
 Return the current local time zone offset expressed as: +/-(HH:MM)
 
def zone
 Return the current local time zone.
 
def localString
 Format the given local time according to the specified format. More...
 
def gmtString
 Formats the given GMT time according to the specified format. More...
 
def measureFromSeconds
 Return the number of seconds specified as a string of the form: XX years, XXX days, XX hours, XX minutes and XX seconds
 

Static Public Attributes

dictionary formatGMT
 Ways to format Greenwich Mean Time. More...
 
dictionary formatLocal
 Ways to format local time. More...
 
string formatTZOffset = "{hours}:{minutes}"
 The format used to create a representation of the time zone offset.
 
dictionary formatMeasurements
 The format used to create a representation of the passage of time. More...
 
dictionary measuringOrder
 The order in which to measure time. More...
 

Detailed Description

A utility class that provides routines to handle time.

Member Function Documentation

def Library.String.Utilities.Time.gmtString (   Self,
  when = None,
  fmt = "" 
)

Formats the given GMT time according to the specified format.

The fmt parameter can specify a format string to pass to strftime(), or it can name one of the pre-defined formats specified in Time.formatGMT. If fmt is not given, a "readable" version of GMT time is returned.

when should be time specified must be a tuple or struct_time that represents a time as returned by gmtime() or localtime(). If no time is given, the current system time is used.

def Library.String.Utilities.Time.localString (   Self,
  when = None,
  fmt = "" 
)

Format the given local time according to the specified format.

The fmt parameter can specify a format string to pass to strftime(), or it can name one of the pre-defined formats specified in Time.formatLocal. If fmt is not given, a "readable" version of local time is returned.

when should be time specified must be a tuple or struct_time that represents a time as returned by gmtime() or localtime(). If no time is given, the current system time is used.

def Library.String.Utilities.Time.now (   Self)

Return the current local time as the number of seconds since the Unix epoch.

Member Data Documentation

dictionary Library.String.Utilities.Time.formatGMT
static
Initial value:
1 = {
2  ## The format used to create a representation of GMT (RFC 2822)
3  "rfc2822": "%a, %d %b %Y %H:%M:%S GMT",
4  ## The format used to create a representation of GMT (RFC 3339)
5  "rfc3339": "%Y-%m-%dT%H:%M:%SZ",
6  ## The format used to create a readable representation of GMT
7  "readable": "%A, %d %B %Y %H:%M:%S GMT"
8  }

Ways to format Greenwich Mean Time.

dictionary Library.String.Utilities.Time.formatLocal
static
Initial value:
1 = {
2  ## The format used to create a representation of local time (RFC 2822)
3  "rfc2822": "%a, %d %b %Y %H:%M:%S %Z",
4  ## The format used to create a representation of local time (RFC 3339)
5  "rfc3339": "%Y-%m-%dT%H:%M:%S",
6  ## The format used to create a readable representation of local time
7  "readable": "%A, %d %B %Y %I:%M:%S %p %Z"
8  }

Ways to format local time.

dictionary Library.String.Utilities.Time.formatMeasurements
static
Initial value:
1 = {
2  "singular": {
3  "year": "year",
4  "day": "day",
5  "hour": "hour",
6  "minute": "minute",
7  "second": "second"
8  },
9 
10  "plural": {
11  "year": "years",
12  "day": "days",
13  "hour": "hours",
14  "minute": "minutes",
15  "second": "seconds"
16  }
17  }

The format used to create a representation of the passage of time.

dictionary Library.String.Utilities.Time.measuringOrder
static
Initial value:
1 = {
2  "year": 60 * 60 * 24 * 365.2425,
3  "day": 60 * 60 * 24,
4  "hour": 60 * 60,
5  "minute": 60,
6  "second": 1
7  }

The order in which to measure time.


The documentation for this class was generated from the following file: