Search notes:

PL/SQL package TIM: test

This is the simple test script for the PL/SQL package TIM.
@spec
@body

begin

   if tim.s_ago(sysdate       - 1/24       ) != 3600 then
      raise_application_error(-20800, 'tim.s_ago(date)');
   end if;

   if tim.s_ago(systimestamp  - 1/24       ) != 3600 then
      raise_application_error(-20800, 'tim.s_ago(systimestamp)');
   end if;

   if tim.to_s (to_dsinterval('1 00:01:01')) != 86461 then
      raise_application_error(-20800, 'tim.to_s');
   end if;

   if tim.iso_8601(date '2021-06-26') != '2021-06-26T00:00:00Z' then
      raise_application_error(-20800, 'tim.iso_8601');
   end if;

   if tim.iso_8601(timestamp '2021-06-26 11:57:18.123') != '2021-06-26T11:57:18.123Z' then
      raise_application_error(-20800, 'tim.iso_8601');
   end if;

   if tim.iso_8601(timestamp '2021-06-26 11:57:18.123+02:00') != '2021-06-26T11:57:18.123+02:00' then
      raise_application_error(-20800, 'tim.iso_8601');
   end if;

end;
/
Github repository PL-SQL-pkg-tim, path: /test.sql

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...', 1759398446, '216.73.216.42', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/development/databases/Oracle/PL-SQL/libs/personal/tim/test(66): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78