Re: DateTime: (now.Int) always 37 seconds off from (now)
[email protected] (Bruce Gray) Fri, 29 Aug 2025 09:23:37 -0500
| Newsgroups | perl.perl6.users |
|---|---|
| Message-ID | <[email protected]> |
> On Aug 29, 2025, at 09:14, Mark Devine <[email protected]> wrote: > > Rakoons, --snip-- > 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 > Hi Mark, This should work: raku -e 'say DateTime.now.truncated-to("second");' 2025-08-29T09:18:57-05:00 Docs: https://docs.raku.org/type/DateTime#method_truncated-to -- Hope this helps, Bruce Gray (Util of PerlMonks)