Skip to content

consider moving from DateTime to Time #22

Description

@matkoniecz

Apparently, DateTime should not be used except rare cases

So when should you use DateTime in Ruby and when should you use Time? Almost certainly you'll want to use Time since your app is probably dealing with current dates and times. However, if you need to deal with dates and times in a historical context you'll want to use DateTime to avoid making the same mistakes as UNESCO.

https://ruby-doc.org/stdlib-2.3.0/libdoc/date/rdoc/DateTime.html#top

Given that Beeminder is not older than Gregorian calendar DateTime should not be used.

Found via Rubocop complaints ( https://github.com/rubocop-hq/ruby-style-guide#date--time )

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions