Search notes:

Shell: Calculate and/or display elapsed time

date +%s returns the Unix time, that is the number of seconds that have elapsed since January 1st 1970. This allows to calculate the number of elapsed seconds in a shell script in combination with expr:
T0=$( date +%s )

# do stuff (or take a nap):
sleep 10

echo time elapsed: $( expr $( date +%s ) - $T0 )

See also

Date arithmetic in a shell

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/Linux/sh...', 1759338455, '216.73.216.88', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Linux/shell/commands/date/elapsed-time(42): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78