DateTime: (now.Int) always 37 seconds off from (now)

[email protected] (Mark Devine) Fri, 29 Aug 2025 14:14:36 +0000
Newsgroups perl.perl6.users
Message-ID <DM5PR02MB32108880705B7622A4667755A03AA@DM5PR02MB3210.namprd02.prod.outlook.com>
Rakoons,

I have a trace memory about this issue, but alas, I can't recall.

Welcome to Rakudo(tm) v2025.08.
Implementing the Raku(r) Programming Language v6.d.
Built on MoarVM version 2025.08.

raku -e 'my $inst = now; put DateTime.new($inst).local, "\t", DateTime.new($inst.Int).local;'
2025-08-28T07:31:01.681240-04:00 2025-08-28T07:31:38-04:00

I expected same integer seconds when instantiating DateTime with now & now.Int. What am I missing?

In the end, I'm looking for elegant mechanics to get DateTime objects from multiple sources (including now), perform calculations, etc., then produce this format using .Str:

YYYY-MM-DDTHH:MM:SS-04:00

not this format:

YYYY-MM-DDTHH:MM:SS.806520-04:00

Thanks,

Mark