Maximum(:created_at)
does not give the timestamp in local time format but in UTC.
I am using Rails 2.3.8开发者_JAVA技巧
Is there another way to get the latest created_at in local time?
You can use the getlocal
method of the Time
class, to obtain the local time from an UTC time.
精彩评论