Skip to content

Commit cf182e3

Browse files
committed
Document Date.daycount|Int|Numeric
1 parent 59ffd07 commit cf182e3

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

doc/Type/Date.pod6

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ Optionally accepts a formatter as a named parameter.
7070
7171
say Date.new-from-daycount(49987); # OUTPUT: «1995-09-27␤»
7272
73+
=head2 method daycount
74+
75+
method daycount(Date:D: --> Int:D)
76+
77+
Returns the number of days from epoch Nov. 17, 1858, i.e. the
78+
L<Modified Julian Day|https://en.wikipedia.org/wiki/Julian_day>.
79+
7380
=head2 method last-date-in-month
7481
7582
method last-date-in-month(Date:D: --> Date:D)
@@ -182,6 +189,25 @@ Converts the invocant to L«C<DateTime>|/type/DateTime»
182189
say Date.new('2015-12-24').DateTime; # OUTPUT: «2015-12-24T00:00:00Z␤»
183190
say Date.DateTime; # OUTPUT: «(DateTime)␤»
184191
192+
=head2 method Int
193+
194+
multi method Int(Date:D --> Int:D)
195+
196+
Converts the invocant to L«C<Int>|/type/Int». The same value can be
197+
obtained with the C<daycount> method.
198+
199+
Available as of release 2023.02 of the Rakudo compiler.
200+
201+
=head2 method Numeric
202+
203+
multi method Numeric(Date:D --> Int:D)
204+
205+
Converts the invocant to L«C<Int>|/type/Int». The same value can be
206+
obtained with the C<daycount> method. This allows C<Date> objects to
207+
be used directly in arithmetic operations.
208+
209+
Available as of release 2023.02 of the Rakudo compiler.
210+
185211
=head1 Functions
186212
187213
=head2 sub sleep

0 commit comments

Comments
 (0)