Documentation for routine Date

Documentation for routine Date, assembled from the following types:

class Date

From Date

(Date) method Date

Defined as:

method Date(--> Date)

Returns the invocant.

say'2015-12-24').Date;  # OUTPUT: «2015-12-24␤» 
say Date.Date;                    # OUTPUT: «(Date)␤» 

class DateTime

From DateTime

(DateTime) method Date

Defined as:

multi method Date(DateTime:U --> Date:U)
multi method Date(DateTime:D --> Date:D)

Converts the invocant to Date.

say"2012-02-29T12:34:56.946314Z").Date# OUTPUT: «2012-02-29␤» 
say DateTime.Date;                                    # OUTPUT: «(Date)␤» 

class Instant

From Instant

(Instant) method Date

Defined as:

method Date(Instant:D: --> Date:D)

Coerces the invocant to Date.

my $i = "/etc/passwd".IO.modified;
say $i;             # OUTPUT: «Instant:1451489025.878018␤» 
say $i.Date;        # OUTPUT: «2015-12-30␤»