Skip to content

CronParser#last gives incorrect time #17

@jessebs

Description

@jessebs

The following produces an incorrect last time:

cron_parser = CronParser.new('* * * * *')
p "Now: #{Time.now}"
p "Last: #{cron_parser.last}"
p "Next: #{cron_parser.next}"

The output is

"Now: 2014-05-12 13:15:42 -0600"
"Last: 2014-05-12 13:14:00 -0600"
"Next: 2014-05-12 13:16:00 -0600"

But would expect the output to be (notice 13:15:00 in the "Last:" line)

"Now: 2014-05-12 13:15:42 -0600"
"Last: 2014-05-12 13:15:00 -0600"
"Next: 2014-05-12 13:16:00 -0600"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions