No description, website, or topics provided.
Perl
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib/Time/Piece
t
Changes
MANIFEST
Makefile.PL
README
README.pod
ignore.txt

README.pod

NAME

Time::Piece::Random - create Time::Piece object at random in the specified range

VERSION

Version 0.01

SYNOPSIS

use Time::Piece::Random;

# return Time::Piece Object
Time::Piece::Random->new({ start => '2012-01-01', end =>'2012-02-01' })->get; # 2012-01-01 00:00:00 ~ 2012-02-01 23:59:59
Time::Piece::Random->new({ start => '2012-01-01'})->get; 2012-01-01 00:00:00 ~ now
Time::Piece::Random->new({ end => '2012-05-15' })->get; now ~ 2012-05-15 23:59:59
Time::Piece::Random->new('2012-05-01')->get; # 2012-05-01 00:00:00 ~ 2012-05-01 23:59:59
Time::Piece::Random->new('2012-05')->get;    # 2012-05-01 00:00:00 ~ 2012-05-31 23:59:59
Time::Piece::Random->new('2012')->get;       # 2012-01-01 00:00:00 ~ 2012-12-31 23:59:59

my $tpr =  Time::Piece::Random->new('2012-??-01 00:00:00'); #todo
$tpr->get; #2012-01-01 00:00:00 or 2012-02-01 00:00:00 or ..... 2012-12-01 00:00:00


my $tp  = Time::Piece->new;
my $tp2 = $tp + ONE_DAY;
Time::Piece::Random->new({ start => $tp, end => tp2 });

SUBROUTINES/METHODS

new

create_start

create_end

get

get_multi

AUTHOR

Kouji Tominaga, <tokubass at cpan.org>

SEE ALSO

http://search.cpan.org/perldoc?DateTime%3A%3AEvent%3A%3ARandom

LICENSE AND COPYRIGHT

Copyright 2012 Kouji Tominaga.

This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.

See http://dev.perl.org/licenses/ for more information.