Search notes:

Perl function: localtime

use warnings;
use strict;

my ($second, $minute, $hour, $day_of_month, $month, $year, $day_of_week, $day_of_year, $daylight_saving_time) = localtime(time);

$month ++;      # localtime returns 0 for January, 1 for February etc
$year  += 1900; # year is 1900 years to early

printf("%4d-%02d-%02d %02d:%02d:%02d", $year, $month, $day_of_month, $hour, $minute, $second);
Github repository about-perl, path: /functions/localtime.pl

See also

Perl functions

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...', 1758207381, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/languages/Perl/functions/localtime(52): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78