File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change @@ -416,15 +416,10 @@ last modified.
416
416
417
417
say "path/to/file".IO.modified; # e.g. Instant:1424089165
418
418
419
- To obtain a human-readable form of the timestamp, use a L < DateTime > object:
420
-
421
- say DateTime.new("path/to/file".IO.modified); # e.g. 2015-02-16T12:18:50Z
422
-
423
- or more readably:
419
+ To obtain a human-readable form of the timestamp, call C < DateTime > method
420
+ on the returned C < Instant > , to convert it into a L < DateTime > object:
424
421
425
- my $modification_instant = "path/to/file".IO.modified;
426
- my $modification_time = DateTime.new($modification_instant);
427
- say $modification_time; # e.g. 2015-02-16T12:18:50Z
422
+ say "path/to/file".IO.modified.DateTime; # e.g. 2015-02-16T12:18:50Z
428
423
429
424
= head2 method accessed
430
425
You can’t perform that action at this time.
0 commit comments