Skip to content

Time.diff gives wrong answer for February in leap years #2

@alikhajeh1

Description

@alikhajeh1

Time.diff(Time.new(2012, 03, 01), Time.new(2012, 02, 01))
=> {:year=>0, :month=>0, :week=>4, :day=>1, :hour=>0, :minute=>0, :second=>0, :diff=>"4 weeks, 1 day and 00:00:00"}

So it shows the time diff as 4 weeks and 1 days between February and March, but this should be returning 1 month.

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