Rails Raw SQL Insert -- Time Wrong

If the time is incorrect on something that you insert directly into the database when using Rails (off by several hours), try ensuring that you are using the correct modifier to get it into the right time zone. For example, instead of doing DateTime.now, try DateTime.now.utc if you are using UTC as your default timezone.

Categories: development

« Converting ERB to Slim What are Some Great Posts on Debugging Tough Problems? »