![](https://secure.gravatar.com/avatar/8ac615df352a970211b0e3d94a307c6d.jpg?s=120&d=mm&r=g)
Author: david.goodger Date: Wed Apr 2 22:17:47 2008 New Revision: 62109 Modified: sandbox/trunk/datetime/PSF.py Log: new time for PSF Board meetings from April 2008 (12pm noon Eastern) Modified: sandbox/trunk/datetime/PSF.py ============================================================================== --- sandbox/trunk/datetime/PSF.py (original) +++ sandbox/trunk/datetime/PSF.py Wed Apr 2 22:17:47 2008 @@ -10,7 +10,7 @@ from dateutil import MONDAY, weekday_of_month from US import Eastern, Central, Mountain, Pacific -from EU import UTC, London, Amsterdam +from EU import UTC, WesternEU, CentralEU, EasternEU, London, Amsterdam, Berlin alltzs = {'Eastern': Eastern, 'Central': Central, @@ -19,14 +19,25 @@ 'UTC': UTC, 'London': London, 'Amsterdam': Amsterdam, + 'Berlin': Berlin, + 'WesternEU': WesternEU, + 'CentralEU': CentralEU, + 'EasternEU': EasternEU, } # A vector of 12 datetimes, all in Eastern. def psf_times_for_a_year(year): - # 1pm Eastern on the second Monday of the month. + # Until March 2008: 1pm Eastern on the second Monday of the month. base = datetime(year, 1, 1, 13, tzinfo=Eastern) - return [weekday_of_month(MONDAY, base.replace(month=i), 1) - for i in range(1, 13)] + if year >= 2008: + # From April 2008: 12pm (noon) Eastern. + base = base.replace(hour=12) + times = [weekday_of_month(MONDAY, base.replace(month=i), 1) + for i in range(1, 13)] + if year == 2008: + # Adjust the hour of the first 3 months: + times[:3] = [time.replace(hour=13) for time in times[:3]] + return times # Eastern is always displayed first. def display_psf_times_for_a_year(year, tzs):
participants (1)
-
david.goodger