Discussion:
Remote RoR....
Traci Martin
2017-02-07 17:31:30 UTC
Permalink
Please don’t kill me for posting here, but I have Sr. level, possibly CTO level, RoR Developer position—It’s REMOTE! Please email me if you are interested.

Let the angry mob commence
.

[cid:***@01D28135.9DED4C70]

[cid:***@01D0FF4A.57A33180]

Traci Martin | Interactive Resources

Sr. Account Recruiting Manager | ***@IRtalent.com<mailto:***@IRtalent.com>

o 512.467.4631
ext. 4202 | c 512.750.1948

IRtalent.com<http://www.irtalent.com/> | Connect with me on LinkedIn<https://www.linkedin.com/in/traci-martin-47456214>




From: ruby-talk [mailto:ruby-talk-***@ruby-lang.org] On Behalf Of Colin Bartlett
Sent: Monday, February 6, 2017 7:15 PM
To: Ruby users <ruby-***@ruby-lang.org>
Subject: Re: Datetime

I know quite a bit about Date, DateTime, Time, albeit more from the Ruby and C code than from the documentation, and I don't think this is an unreasonable general question: there are quite a lot of methods in all three classes, so I don't think I'd expect someone to compare all the methods before asking a question like this.
I think it might be helpful if at the beginning of
http://ruby-doc.org/stdlib-2.3.1/libdoc/date/rdoc/Date.html
http://ruby-doc.org/stdlib-2.3.1/libdoc/date/rdoc/DateTime.html
it stated that Time always uses the Gregorian Calendar but Date and DateTime allow you to use the Julian Calendar or a Julian Calendar which at a date of your choice switches to the Gregorian Calendar.
So - subject to the caveat I end this post with - use Time if you only need the Gregorian Calendar, and use DateTime if you need the Julian Calendar or a calendar which starts as Julian and later switched to Gregorian.
That is what is being said here:
http://ruby-doc.org/stdlib-2.3.1/libdoc/date/rdoc/DateTime.html
A subclass of Date<http://ruby-doc.org/stdlib-2.3.1/libdoc/date/rdoc/Date.html> that easily handles date, hour, minute, second and offset.
...
So when should you use DateTime in Ruby and when should you use Time? Almost certainly you’ll want to use Time since your app is probably dealing with current dates and times. However, if you need to deal with dates and times in a historical context you’ll want to use DateTime to avoid making the same mistakes as UNESCO. If you also have to deal with timezones then best of luck - just bear in mind that you’ll probably be dealing with local solar times<http://en.wikipedia.org/wiki/Solar_time>, since it wasn’t until the 19th century that the introduction of the railways necessitated the need for Standard Time<http://en.wikipedia.org/wiki/Standard_time#Great_Britain> and eventually timezones.
...

So if for some reason you need a mixed Julian-Gregorian calendar which will be used for both historical dates and times and for current dates and times with timezones then neither Time nor DateTime will work.

Caveat: I think the answer isn't quite as simple as that DateTime documentation implies, because there are some useful Date and DateTime construction and singleton methods which aren't standard in Time. For example: commercial, ordinal, leap?
Loading...