Package s3 :: Module s3datetime :: Class S3DateTime
[frames] | no frames]

Class S3DateTime

source code

object --+
         |
        S3DateTime

Toolkit for date+time parsing/representation

Instance Methods

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Methods
 
date_represent(cls, dt, format=None, utc=False, calendar=None)
Represent the date according to deployment settings &/or T()
source code
 
datetime_represent(cls, dt, format=None, utc=False, calendar=None)
Represent the datetime according to deployment settings &/or T()
source code
 
time_represent(cls, time, format=None, utc=False)
Represent the date according to deployment settings &/or T()
source code
Static Methods
 
get_offset_value(string)
Convert an UTC offset string into a UTC offset value in seconds
source code
Properties

Inherited from object: __class__

Method Details

date_represent(cls, dt, format=None, utc=False, calendar=None)
Class Method

source code 

Represent the date according to deployment settings &/or T()

Parameters:
  • dt - the date (datetime.date or datetime.datetime)
  • format - the format (overrides deployment setting)
  • utc - the date is given in UTC
  • calendar - the calendar to use (defaults to current.calendar)

datetime_represent(cls, dt, format=None, utc=False, calendar=None)
Class Method

source code 

Represent the datetime according to deployment settings &/or T()

Parameters:
  • dt - the datetime
  • utc - the datetime is given in UTC
  • calendar - the calendar to use (defaults to current.calendar)

time_represent(cls, time, format=None, utc=False)
Class Method

source code 

Represent the date according to deployment settings &/or T()

Parameters:
  • time - the time
  • format - the time format (overrides deployment setting)
  • utc - the time is given in UTC

get_offset_value(string)
Static Method

source code 

Convert an UTC offset string into a UTC offset value in seconds

Parameters:
  • string - the UTC offset in hours as string, valid formats are: "+HH:MM", "+HHMM", "+HH" (positive sign can be omitted), can also recognize decimal notation with "." as mark