NAME

Bot::BasicBot::Pluggable::Module::DateTimeCalc - Calculate date-time operations

VERSION

version 0.0400

SYNOPSIS

  use Bot::BasicBot::Pluggable::Module::DateTimeCalc;
  my $bot = Bot::BasicBot::Pluggable::Module::DateTimeCalc->new(
    server      => 'irc.somewhere.org',
    port        => '6667',
    channels    => ['#bots'],
    nick        => 'TimeBot',
    name        => 'Your Name Bot',
    ignore_list => [qw/other_bot some_fool/],
  );
  $bot->run;

DESCRIPTION

A Bot::BasicBot::Pluggable::Module::DateTimeCalc calculates date-time operations.

This bot is coded to only respond when directly addressed, btw.

Since this module uses DateTime::Format::Natural, many different date-time formats are supported.

METHODS

new

Create a new Bot::BasicBot::Pluggable::Module::DateTimeCalc object.

help

Show the keyword help message.

said

Process the date-time calculations.

run

Start the process and connect to the IRC.

IRC COMMANDS

help

  > TimeBot: help

Show the keyword help message.

source

  > TimeBot: source

Return the github repository where this is hosted.

now

  > TimeBot: now

Return the current date and time.

localtime

  > TimeBot: localtime 123456

Return the date-time string given an epoch time.

dow

  > TimeBot: dow 2018-06-24

Return the day of the week for the given date-time stamp.

diff

  > TimeBot: diff '2018-06-24 17:51:17' '1/2/2032'

Return a duration string in days, hours, minutes and seconds from two date-time stamps.

{add,sub}_{years,months,days,hours,minutes,seconds}

  > TimeBot: add_days 3 '1/2/2032'

Add or subtract the the given span from the given date-time stamp.

leave

  > TimeBot: leave

Exit the IRC and the running process.

SEE ALSO

Bot::BasicBot::Pluggable

DateTime

DateTime::Format::Natural

AUTHOR

Gene Boggs <gene@cpan.org>

COPYRIGHT AND LICENSE

This software is copyright (c) 2019 by Gene Boggs.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.