0.0
Low commit activity in last 3 years
No release in over a year
Accepts a cron expression and outputs the relative time (e.g. 0 7 1 1 * * => 2019-01-01 07:00:00 +0000
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.3.0, ~> 0.3
 Project Readme

Introducing the cron_format gem

The cron_format gem accepts a cron expression and returns a time.

require 'cron_format'

cron_entry = '1 * * * *'
date1 = Time.parse('2013-07-07 15:19:00 +0100')
cf = CronFormat.new(cron_entry, date1)
cf.to_time.strftime("%Y-%m-%d %H:%M")
#=> "2013-07-07 16:01"

CronFormat.new('1 15 * * *', Time.parse('2013-07-07 15:19:00')).to_time
#=> 2013-07-08 15:01:00 +0100

time gem cron_format cron