How to change date format in rails -
is normal rails put :
datetime.now = 2013-07-28t16:21:13+02:00
why t between date , time ? how can remove it. in i18n have default:
default: ! '%a, %d %b %y %h:%m:%s %z'
in irb console, if call puts variable
, make implicit call method to_s
on variable
object:
1.9.3 > datetime.now # => wed, 28 aug 2013 10:39:30 -0400 1.9.3 > puts datetime.now 2013-08-28t10:39:33-04:00 # => nil 1.9.3 > datetime.now.to_s # => "2013-08-28t10:39:37-04:00"
this why see "t" in output, .to_s
's fault!
Comments
Post a Comment