3 Responses to Edge Rails: Time#current

  1. protip: If your website deals heavily with different Time Zones, you need to use Time.current.to_date instead of Date.today when automatically setting the date for some attribute.

    For instance, if your server is in the Eastern Time Zone, and someone is using the system at 11 PM in the Pacific time zone, you will get the wrong date.

    Anyone have any comments about overriding Date.today to use Time.current.to_date when config.time_zone is set? Good idea or bad idea that might get you in trouble?

Leave a Reply

Your email address will not be published. Required fields are marked *