10 Temmuz 2009, Cuma
Dönüşüm Ruby on Rails basit Tarih DateTime
Kullanıcılar için zaman basit bir tarih dönüştürmek istiyorum db datetime sütun var.
Bunu nasıl yapabilirim?
def shown_date # to_date does not exist, but is what I am looking for self.date || self.exif_date_time_original.to_date end
CEVAP
10 Temmuz 2009, Cuma
DateTime#to_date
ActiveSupport ile var:
$ irb
>> DateTime.new.to_date
NoMethodError: undefined method 'to_date' for #<DateTime: -1/2,0,2299161>
from (irb):1
>> require 'active_support/core_ext'
=> true
>> DateTime.new.to_date
=> Mon, 01 Jan -4712
Bunu Paylaş:
Java arasında basit dönüşüm.açıklama.T...
Ruby/Rails: bir UNİX zaman damgası içi...
Bir dize olup olmadığını kontrol geçer...
'DateTime, zaman Damgası, Zaman v...
"" zaman fonksiyonları tarih...