summaryrefslogtreecommitdiff
path: root/README.rst
diff options
context:
space:
mode:
authorMathieu Le Marec - Pasquet <kiorky@cryptelium.net>2020-05-08 22:25:41 +0100
committerMathieu Le Marec - Pasquet <kiorky@cryptelium.net>2020-05-27 16:16:22 +0200
commit1622f9b36fe6fcabee0e69b1daab61c7c50a9af5 (patch)
tree82a5bf61cb586a275b553c4620bed78186c5e30d /README.rst
parent1786e445f579fcd076023b1fe09a648660c5e4e1 (diff)
downloadcroniter-1622f9b36fe6fcabee0e69b1daab61c7c50a9af5.tar.gz
Document more second repeats.
This fixes taichino/croniter#122
Diffstat (limited to 'README.rst')
-rw-r--r--README.rst15
1 files changed, 15 insertions, 0 deletions
diff --git a/README.rst b/README.rst
index f59817c..6979454 100644
--- a/README.rst
+++ b/README.rst
@@ -95,6 +95,21 @@ Be sure to init your croniter instance with a TZ aware datetime for this to work
>>> local_date = tz.localize(datetime(2017, 3, 26))
>>> val = croniter('0 0 * * *', local_date).get_next(datetime)
+About second repeats
+=====================
+Croniter is able to do second repeatition crontabs form
+
+ >>> croniter('* * * * * 1', local_date).get_next(datetime)
+ >>> base = datetime(2012, 4, 6, 13, 26, 10)
+ >>> itr = croniter('* * * * * 15,25', base)
+ >>> itr.get_next(datetime) # 4/6 13:26:15
+ >>> itr.get_next(datetime) # 4/6 13:26:25
+ >>> itr.get_next(datetime) # 4/6 13:27:15
+
+You can also note that this expression will repeat every second from the start datetime.
+
+ >>> croniter('* * * * * *', local_date).get_next(datetime)
+
Develop this package
====================