Commits

Toby Inkster  committed d8871d9

Don't use constant; document Time::HiRes usage.

  • Participants
  • Parent commits 5da2fa8

Comments (0)

Files changed (1)

File lib/DateTimeX/Format/Ago.pm

 
 use 5.010;
 use common::sense;
-use constant { FALSE => 0, TRUE => 1 };
 use utf8;
 
 BEGIN {
 	Carp::croak(sprintf("%s doesn't know about language '%s'", __PACKAGE__, $self->{language}));
 }
 
-TRUE;
-
+__PACKAGE__
 __END__
 
 =head1 NAME
 
 =back
 
-=head1 BUGS
+=head1 BUGS AND LIMITATIONS
+
+=head2 High resolution datetimes
+
+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
+C<< 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 L<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".
+
+=head2 Reporting Bugs
 
 Please report any bugs to
 L<http://rt.cpan.org/Dist/Display.html?Queue=DateTimeX-Format-Ago>.