Creates a formatter object for the given language (a BCP47 language code). If the language is omitted, extracts it from $ENV{LANG}.

Decent English ('en'), German ('de'), French ('fr'), Portuguese ('pt'), Korean ('ko'), and Indonesian ('id') support is provided. Castillian Spanish ('es') is also provided, but some of the strings were translated with Google Translate, so they might not be perfect.

Imagine the time is currently 2020-01-01T12:00:00.200. If you try to format the time 2020-01-01T12:00:00.100 you'll get back the result "in the future". So what's going on? DateTimeX::Format::Ago figures out when "now" is using DateTime->now, which rounds back to the nearest whole second.

If you know you're going to be dealing with high resolution datetimes, and don't want to occasionally see "in the future" for times in the very recent past, then use Time::HiRes.

use Time::HiRes qw();

That's all you need to do. Merely loading it will give DateTimeX::Format::Ago an indication that you want it to use a more accurate idea of "now".