2

I have a method DateTime.civil(...) want to ignore dst on this

I can check the dst using dst? isdst but how can I ignore dst?

Any kind of help will be really helpful for me.

I got some links like Rails ignore daylight savings time also many other but they are even not much helpful

but they are not ignore dst from Datetime.civil functionality

we can skip it in model using skip_time_zone_conversion_for_attributes same thing can we do for view I do not want to show it as string

thanks in advance

Community
  • 1
  • 1
  • Why would you ignore DST? Don't you just mean you want to print a date without DST information? Or do you want UTC time? – zwippie Sep 09 '13 at 10:13
  • There is a similar question here [Make Rails ignore daylight saving time][1] [1]: http://stackoverflow.com/questions/18541571/make-rails-ignore-daylight-saving-time-when-displaying-a-date – Bala Sep 09 '13 at 10:13
  • no.... @Bala i have also find that..but thanks –  Sep 09 '13 at 10:29
  • @zwippie I want the print date without dst –  Sep 09 '13 at 10:30
  • @badal Then take a look at the [Time#strftime docs](http://www.ruby-doc.org/core-1.9.3/Time.html#method-i-strftime) – zwippie Sep 09 '13 at 10:44
  • @zwippie you did not get my point actually we can skip it in model using `skip_time_zone_conversion_for_attributes` same thing can we do for view I do not want to show it as string –  Sep 09 '13 at 10:54
  • If you are not going to print the date, what will you do with it? On the topic of timezones and DST: if the [link from Bala](http://stackoverflow.com/questions/18541571/make-rails-ignore-daylight-saving-time-when-displaying-a-date) did not help, perhaps [this one](http://stackoverflow.com/questions/2532729/daylight-saving-time-and-time-zone-best-practices) will. – zwippie Sep 09 '13 at 13:25

0 Answers0