The modified routine

Combined from primary sources listed below.

In class IO::Path ( Type/IO/Path )§

See primary docmentation in context for method modified.

method modified§

Returns an Instant object indicating when the content of the file was last modified. Compare with changed.

say "path/to/file".IO.modified;          # Instant:1424089165
say "path/to/file".IO.modified.DateTime# 2015-02-16T12:18:50Z

In class IO::Special ( Type/IO/Special )§

See primary docmentation in context for method modified.

method modified§

method modified(IO::Special:D: --> Instant)

The last modified time for the filehandle. It always returns an Instant type object.

In class DateTime ( Type/DateTime )§

See primary docmentation in context for method modified.

method modified-julian-date§

method modified-julian-date(DateTime:D: --> Real:D)

Returns the Modified Julian Date (MJD) for the UTC date and time.

say DateTime.new('2021-12-24T12:23:00.43Z').modified-julian-date; # OUTPUT: «59572.5159772␤»

Notice the fractional part of the modified-julian-date is same value as the day-fraction for the same instant. Likewise, the integral part of the MJD is the same value as the daycount for the same instant since they reference the same epoch (November 17, 1858). The MJD is obtained by subtracting the constant 2_400_000.5 from the Julian Date and is used to simplify transformations between civil and astronomical time systems.

Available as of the 2021.04 Rakudo compiler release.