Search notes:

System.TimeSpan (struct)

A System.TimeSpan represents the elapsed time between two time points which are represented by the System.DateTime struct.

Parse

In PowerShell, Parse() is the default method of the [timespan), so, in PowerShell, a timespan can be initialized like so:
[timespan] $two_minutes    =     '0:02'
[timespan] $four_hours     =     '4:00'
[timespan] $seven_seconds  =     '0:00:07'
[timespan] $three_days     =  '3:00:00:00'

[timespan] $negative_span  =    '-0:04'

ToString()

ToString() can be used to format a time span. Literal text must be enclosed within single quotes, or escaped with backslashes:
PS C:\> $ts = new-object TimeSpan 1, 23, 4, 56
PS C:\> $ts.ToString("d'd 'hh'h 'mm'm 'ss's'")
1d 23h 04m 56s
PS C:\> $ts.ToString("d\d\ hh\h\ mm\m\ ss\s")
1d 23h 04m 56s

See also

System.Diagnostics.Stopwatch is a class that allows to measure elapsed time. After measuring the elapsed period, it is returned by the Stopwatch's Elapsed property.
The PowerShell cmdLet new-timeSpan

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/Microsof...', 1740462986, '18.188.12.188', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/dot-net/namespaces-classes/System/TimeSpan(60): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78