Search notes:

Perl module DateTime

The DateTime modules is used to represent dates and times.
use warnings;
use strict;

use DateTime;


my $date_1 = DateTime->new(year => 2014, month => 7, day => 5);
my $date_2 = DateTime->new(year => 2014, month => 7, day =>15);

#  Calculate Δ
#    delta_tays() returns a DateTime::Duration object
printf "date_2 (%s) is %d days away from date_1 (%s)\n", $date_2 -> dmy, $date_1->delta_days($date_2)->delta_days, $date_1 -> dmy;

my $today = today DateTime;

printf "Tdoay is %s\n", $today->dmy;
Github repository PerlModules, path: /DateTime/script.pl

See also

The .NET struct System.DateTime.
Perl modules.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/developm...', 1744798859, '18.189.1.87', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Perl/modules/DateTime/index(59): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78