summaryrefslogtreecommitdiff
path: root/example.py
diff options
context:
space:
mode:
authorniemeyer <>2005-02-23 18:33:30 +0000
committerniemeyer <>2005-02-23 18:33:30 +0000
commitdebf3cd82a0aa85949c84eefa13eab5fd5be3949 (patch)
treedc73cefb189c3bb02209ded216fdd74405142f72 /example.py
parentf57df0b03af23f5459cb6bc04fdc4a02e58eac50 (diff)
downloaddateutil-debf3cd82a0aa85949c84eefa13eab5fd5be3949.tar.gz
- Now tzfile() will unpickle to the updated file.
- Adding tzwin.py, contributed by Jeffrey Harris. - Minor tweaks in setup.py. - Adding README and example.py. - Putting old scheduler.py in the sandbox.
Diffstat (limited to 'example.py')
-rw-r--r--example.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/example.py b/example.py
new file mode 100644
index 0000000..f5a8e6f
--- /dev/null
+++ b/example.py
@@ -0,0 +1,15 @@
+from dateutil.relativedelta import *
+from dateutil.easter import *
+from dateutil.rrule import *
+from dateutil.parser import *
+from datetime import *
+import commands
+import os
+now = parse(commands.getoutput("date"))
+today = now.date()
+year = rrule(YEARLY,bymonth=8,bymonthday=13,byweekday=FR)[0].year
+rdelta = relativedelta(easter(year), today)
+print "Today is:", today
+print "Year with next Aug 13th on a Friday is:", year
+print "How far is the Easter of that year:", rdelta
+print "And the Easter of that year is:", today+rdelta