Time::Fuzzy - Time read like a human, with some fuzziness
use Time::Fuzzy; my $now = fuzzy(); $Time::Fuzzy::FUZZINESS = 'low'; # or 'high', 'medium' (default) my $fuz = fuzzy( DateTime->new(...) ); my $fuzzy = Time::Fuzzy->new; print $fuzzy->as_str;
Nobody will ever say "it's 11:57". People just say "it's noon".
This Perl module does just the same: it adds some human fuzziness to the way computer deal with time.
By default, Time::Fuzzy is using a medium fuzziness factor. You can change that by modifying $Time::Fuzzy::FUZZINESS. The accepted values are low, medium or high.
Time::Fuzzy
$Time::Fuzzy::FUZZINESS
low
medium
high
Return the fuzzy time defined by $dt, a DateTime object. If no argument, return the (fuzzy) current time.
$dt
DateTime
If you prefer, you can use Time::Fuzzy in a OOP style. In that case, the following methods are available.
This is the constructor. It accepts the following params:
Additionally, the accessors dt and fuzziness are available.
dt
fuzziness
Return the fuzzy string of the current time of the object. This method is also the overloaded stringified method.
Please report any bugs or feature requests to < bug-time-fuzzy at rt.cpan.org>, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Time-Fuzzy. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
< bug-time-fuzzy at rt.cpan.org>
Time::Fuzzy development takes place on http://time-fuzzy.googlecode.com - feel free to join us.
You can also look for information on this module at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Time-Fuzzy
CPAN Ratings
http://cpanratings.perl.org/d/Time-Fuzzy
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Time-Fuzzy
Jerome Quelin, <jquelin at cpan.org>
<jquelin at cpan.org>
Copyright (c) 2007 Jerome Quelin, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Time::Fuzzy, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Time::Fuzzy
CPAN shell
perl -MCPAN -e shell install Time::Fuzzy
For more information on module installation, please visit the detailed CPAN module installation guide.