Author: moritz
Date: 2010-04-18 13:17:58 +0200 (Sun, 18 Apr 2010)
New Revision: 30403

[S32::Temporal] Date <-> DateTime integration

* DateTime constructor which takes a Date object, as suggested by Mark J. Reed
* DateTime.Date coercion method
* Remove, since date-only calculations are meant be done by the
  Date class
* constructor taking a DateTime object

Modified: docs/Perl6/Spec/S32-setting-library/Temporal.pod
--- docs/Perl6/Spec/S32-setting-library/Temporal.pod    2010-04-17 22:04:13 UTC 
(rev 30402)
+++ docs/Perl6/Spec/S32-setting-library/Temporal.pod    2010-04-18 11:17:58 UTC 
(rev 30403)
@@ -67,19 +67,6 @@
     my $now =;
-If you're interested in the current date but not the time, you can use
-the C<today> method instead:
-    my $today =;
-This has the same effect as doing C<'day')>; see
-'"Set" methods' below.
-Or if you want to extract the date as a C<Date> object (see below),
-you can use simple type coercion:
-    my $today = $datetime.Date;
 General dates can be specified through the C<new> constructor:
     my $moonlanding = :year(1969), :month(7), :day(16),
@@ -96,6 +83,10 @@
     :timezone   defaults to '+0000' (UTC)
     :formatter  defaults to an iso8601 formatter, see below
+Another multi exists with C<Date :date>
+instead of C<:year>, C<:month> and C<:day> (and the same defaults as listed
 A shorter way to send in date and time information to is providing a
 single string with a full ISO8601 date and time. The example from above
 would then be
@@ -156,6 +147,9 @@
 The single argument of each of those methods is optional, but the above
 shows the defaults: C<'-'> for dates and C<':'> for times.
+The C<Date> method returns a C<Date> object, and is the same as
 The C<timezone> method returns the C<DateTime::TimeZone> object for the
 C<DateTime> object. The method C<offset> returns the offset from UTC, in
 seconds, of the C<DateTime> object according to the time zone.
@@ -203,14 +197,15 @@
 =head1 Date
-C<Date> objects represent a day without a time component, and allow easier
-manipulation by assuming that integers always mean days.
+C<Date> objects are immutable and represent a day without a time component.
+They allow easier manipulation by assuming that integers always mean days.
 Days, Months and days of week are 1-based.
 =head2 Constructors;               # today's date
+;     # same'2010-12-24');     # YYYY-MM-DD format, :month(12), :day(24));, 12, 24);

Reply via email to