Quantcast
Channel: Are the Date, Time, and DateTime classes necessary? - Stack Overflow
Browsing all 6 articles
Browse latest View live

Answer by Andrew Vit for Are the Date, Time, and DateTime classes necessary?

To summarize what the common ruby time classes are:TimeThis is the basic workhorse core ruby time class.Has date and time attributes (year, month, day, hour, min, sec, subsec)Based on floating-point...

View Article



Answer by Austin Taylor for Are the Date, Time, and DateTime classes necessary?

Another way of thinking of this is that Date and DateTime model time in terms of clocks and calendars, which is useful for describing times to users, and scheduling events. Having a Date without a time...

View Article

Answer by steenslag for Are the Date, Time, and DateTime classes necessary?

I know there is an accepted answer but I have something to add. The Date class is a heavyweight, academic strength class. It can handle all sorts of RFC's, parse the strangest things and converts...

View Article

Answer by sawa for Are the Date, Time, and DateTime classes necessary?

DateTime is a subclass of Date, so whatever you can do with Date can be done with DateTime. But as tadman and steenslag point out, DateTime is slower. See steenslag's answer for how much slower it...

View Article

Answer by Malfist for Are the Date, Time, and DateTime classes necessary?

Yes. Date handles only the date for something, I.E., March 31, 1989. But it does not handle Time, for example, 12:30 PM.DateTime, can handle both, March 31, 1989 12:30 PM EST.Sometimes you don't need...

View Article


Are the Date, Time, and DateTime classes necessary?

What is the purpose of having Date and Time classes when there is a DateTime class that can handle both?

View Article
Browsing all 6 articles
Browse latest View live


Latest Images