开发者

rails TZInfo localize a timestring

开发者 https://www.devze.com 2023-03-22 13:53 出处:网络
I\'m using TZInfo for localization and DST compatible timezone handling. My problem is that i\'m开发者_C百科 generating an email message out of a cronjob and localization method does not work there, w

I'm using TZInfo for localization and DST compatible timezone handling. My problem is that i'm开发者_C百科 generating an email message out of a cronjob and localization method does not work there, what it does is it uses the application's default timezone in environment.rb and displays the time w.r.t that zone. what i want is it should still use my actual timezone settings. For that i would like something like the following:

<%= l log.created_at.in_time_zone("Eastern Time (US & Canada)" %>

something like that.

is there any way i can do this. any method available that does not break the DST thing, coz the reason i'm using TZInfo is DST compatible time conversions.

Regards

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号