Short textual representation of the TimeSpan
- D,d - day
- H,h - hour
- M,m - minute
- S,s - second
For example:
With configuration class:
class Conf
{
public TimeSpan Delay;
}
Section
Parsed to
settings.Get<Conf>("Conf").Delay == TimeSpan.FromDays(1.5)
Section
Parsed to
settings.Get<Conf>("Conf").Delay == TimeSpan.FromHours(80)
Section
Parsed to
settings.Get<Conf>("Conf").Delay == TimeSpan.FromSeconds(600)
This is samples of valid strings:
- -3d
- 3.4d
- 3h30m
- 24h5s
- -72.5d8s
- -72.5d30.4h500m8s
- -72.5D30.4h500M8s
and invalid strings:
- -3p
- 3.4d8d
- 30m3h
- 24h-5s
- -72.5d8.s
- .5d