Respect time zones: Use Time.current and

Reading the current time

Don't use as it's broken when using time zones. \
Instead, use Time.current, DateTime.current or Date.current (the latter actually not being different, but just use it for good measure).

Parsing strings

Don't use Time.parse as it only gives you a Time object.
Use instead for a TimeWithZone.

Arne Hartherz almost 10 years ago
This website uses short-lived cookies to improve usability.
Accept or learn more