-
Notifications
You must be signed in to change notification settings - Fork 343
Closed
Labels
Milestone
Description
> What situation does this request make simpler?
Avoiding long property chains for little purpose.
To find out today's date in a particular zone, I currently have to use:
var date = clock.Now.InZone(zone).LocalDateTime.Date;
Ditto for time of day.
Three options suggest themselves:
1) var date = clock.Now.InZone(zone).Date;
2) var date = clock.Now.InZone(zone).LocalDate;
3) var date = clock.Now.InZone(zone).Local.Date;
In the first two options it would be adding new properties to ZonedDateTime -
either Date and Time, or LocalDate and LocalTime. In the third option it would
be adding "Local" as a synonym for "LocalDateTime", which works nicely here but
is a little bleh. Whatever we do for ZonedDateTime we should do for
OffsetDateTime too.
I *think* I prefer option 1, but equally emphasizing the "local" part is nice
too...
Original issue reported on code.google.com by jonsk...@google.com on 30 Jan 2013 at 11:25