[threeten-dev] [threeten-develop] DateTime interface

Yishai Hornbacher yh at kashrus.com
Thu Dec 13 09:03:42 PST 2012


How about TimeComponent?

-----Original Message-----
From: Stephen Colebourne [mailto:scolebourne at joda.org] 
Sent: Thursday, December 13, 2012 10:42 AM
To: threeten-develop at lists.sourceforge.net; threeten-dev at openjdk.java.net
Subject: [threeten-develop] DateTime interface

Looking at it again, the DateTime interface is not that well named.

Each of the following are implementations of DateTime:

DateTime a = LocalDateTime.now()
DateTime b = ZoneDateTime.now()
DateTime c = LocalDate.now();
DateTime d = LocalTime.now();
DateTime e = Insant.now();
DateTime f = ZoneOffset.UTC;

While LocalDateTime and Zone[d]DateTime make sense, the others make far less sense.

Why does LocalDate implement DateTime when it has no time?
Why does ZoneOffset implement DateTime when it has neither a date nor time?

The purpose of the interface is to effectively represent common access to some part of the date/time domain.

For a long time, the name was Calendrical, but that wasn't much liked.
Some alternatives:
- Calendrical
- Calend
- Moment
- TimeAspect
- Temporal

Personally, I think "temporal" is pretty good. It means "of or relating to time".

Other suggestions welcome, although change is not yet certain.

Note that there are some other related interfaces:
- DateTimeAccessor
- DateTimeField
- PeriodUnit

Some or all of these might also make sense to consider.

Stephen

------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial Remotely access PCs and mobile devices and provide instant support Improve your efficiency, and focus on delivering more value-add services Discover what IT Professionals Know. Rescue delivers http://p.sf.net/sfu/logmein_12329d2d
_______________________________________________
threeten-develop mailing list
threeten-develop at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/threeten-develop


More information about the threeten-dev mailing list