Package logilab :: Package common :: Module date
[frames] | no frames]

Module date

source code

Date manipulation helper functions.

:copyright: 2006-2009 LOGILAB S.A. (Paris, FRANCE), all rights reserved.
:contact: http://www.logilab.fr/ -- mailto:contact@logilab.fr
:license: General Public License version 2 - http://www.gnu.org/licenses

Functions
 
add_days_worked(start, days)
adds date but try to only take days worked into account
source code
 
date_range(begin, end, step=None)
enumerate dates between begin and end dates.
source code
 
datefactory(year, month, day, sampledate) source code
 
days_between(start, end) source code
 
get_national_holidays(begin, end)
return french national days off between begin and end
source code
 
get_step(dateobj) source code
 
nb_open_days(start, end) source code
 
str2date(datestr, sampledate) source code
 
weekday(dateobj) source code
Variables
  FRENCH_FIXED_HOLIDAYS = {'armistice1918': '%s-11-11', 'armisti...
  FRENCH_MOBILE_HOLIDAYS = {'ascension2004': '2004-05-20', 'asce...
  PYDATE_STEP = datetime.timedelta(1)
  __package__ = 'logilab.common'
  __warningregistry__ = {('mxDateTime not found, endsOfMonth won...
  endOfMonth = None
hash(x)
Function Details

date_range(begin, end, step=None)

source code 

enumerate dates between begin and end dates.

step can either be oneDay, oneHour, oneMinute, oneSecond, oneWeek
use endOfMonth to enumerate months


Variables Details

FRENCH_FIXED_HOLIDAYS

Value:
{'armistice1918': '%s-11-11',
 'armistice1945': '%s-05-08',
 'assomption': '%s-08-15',
 'fete_nat': '%s-07-14',
 'fete_travail': '%s-05-01',
 'jour_an': '%s-01-01',
 'noel': '%s-12-25',
 'toussaint': '%s-11-01'}

FRENCH_MOBILE_HOLIDAYS

Value:
{'ascension2004': '2004-05-20',
 'ascension2005': '2005-05-05',
 'ascension2006': '2006-05-25',
 'ascension2007': '2007-05-17',
 'ascension2008': '2008-05-01',
 'ascension2009': '2009-05-21',
 'ascension2010': '2010-05-13',
 'ascension2011': '2011-06-02',
...

__warningregistry__

Value:
{('mxDateTime not found, endsOfMonth won\'t be available',
  <type 'exceptions.UserWarning'>,
  16): True}