method yyyy-mm-dd

Documentation for method yyyy-mm-dd assembled from the following types:

role Dateish

From Dateish

(Dateish) method yyyy-mm-dd

Defined as:

method yyyy-mm-dd(str $sep = "-" --> Str:D)

Returns the date in YYYY-MM-DD format (ISO 8601). The optional positional argument $sep, which defaults to -, is a one-character separator placed between the different parts of the date.

say Date.new("2015-11-15").yyyy-mm-dd;   # OUTPUT: «2015-11-15␤» 
say DateTime.new(1470853583).yyyy-mm-dd# OUTPUT: «2016-08-10␤» 
say Date.today.yyyy-mm-dd("/");          # OUTPUT: «2020/03/14␤»