https://github.com/tarantool/cron-parser
Tarantool cron expression parser
https://github.com/tarantool/cron-parser
Last synced: about 1 year ago
JSON representation
Tarantool cron expression parser
- Host: GitHub
- URL: https://github.com/tarantool/cron-parser
- Owner: tarantool
- Created: 2018-04-18T17:46:26.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-06-25T07:17:11.000Z (about 2 years ago)
- Last Synced: 2025-04-14T15:11:46.400Z (about 1 year ago)
- Language: Lua
- Size: 23.4 KB
- Stars: 7
- Watchers: 29
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Cron Parser Lua Wrapper
cron-parser is a Lua wrapper of ccronexpr C library. It parses a cron-format schedule and calculates the nearest
event date.
# Installation
```
tt rocks install cron-parser
```
# Example
````
local cron = require('cron')
local expr, err = cron.parse('0 */15 * * * *')
if not expr then
print('Error: '..err)
end
local ts = cron.next(expr)
print(os.date('%Y-%m-%d %H:%M:%S', ts))
````
# References
ccronexpr library: https://github.com/staticlibs/ccronexpr