The differences lie in the Ruby types you'll be working with, as the types
correspond with Ruby date and time classes. I suggest you have a look at
their documentation and judge by yourself.
As far as I'm concerned, DateTime has support for timezones and some other
fancy things, while both Date and Time are a little "simpler". Depends on
your needs. I usually just use Date or Time.
--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To post to this group, send email to datam...@googlegroups.com.
To unsubscribe from this group, send email to datamapper+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/datamapper?hl=en.
On Sat, 16 Apr 2011, DAZ wrote:
> Thanks for the reply Michishige. I understand the differences between
> the 3 Ruby date types, but wondered what DM did behind the scenes with
> these ... are there any differences in how they are saved in the
> underlying DB?
>
> DAZ
>
> On Apr 16, 3:49�pm, Michishige Kaito <chris.webs...@gmail.com> wrote:
>> On Sat, 16 Apr 2011, DAZ wrote:
>>> Hi,
>>
>>> The docs say the following date types are available:
>>
>>> �DateTime, Date, Time
>>
>>> I have always just used DateTime, but would actually like to work in
>>> seconds and therefore use a Time object.
>>
>>> Is there any difference in the background in using Time as a type?
>>
>>> e.g.:
>>
>>> �property :created_at, � Time, :default => �proc { |m,p| Time.now}
>>
>>> cheers,
>>
>>> DAZ
>>
>> The differences lie in the Ruby types you'll be working with, as the types
>> correspond with Ruby date and time classes. I suggest you have a look at
>> their documentation and judge by yourself.
>>
>> As far as I'm concerned, DateTime has support for timezones and some other
>> fancy things, while both Date and Time are a little "simpler". Depends on
>> your needs. I usually just use Date or Time.
>
--
You received this message because you are subscribed to the Google Groups "DataMapper" group.
To unsubscribe from this group and stop receiving emails from it, send an email to datamapper+...@googlegroups.com.
To post to this group, send email to datam...@googlegroups.com.
Visit this group at http://groups.google.com/group/datamapper.
For more options, visit https://groups.google.com/groups/opt_out.
-- Blog: http://postmodern.github.com/ GitHub: https://github.com/postmodern Twitter: @postmodern_mod3 PGP: 0xB9515E77
Hi,
thanks for replying! I will try DateTime. I do not really understand the solution, though. If I had tried to use Date, ok, but shouldn't Time work equally in this respect to DateTime?
Best
Kilian
> You received this message because you are subscribed to a topic in the Google Groups "DataMapper" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/topic/datamapper/d5cLJXAznuQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to datamapper+...@googlegroups.com.