Repository navigation
Add TimeSpan
github-actions edited this page May 1, 2026
·
1 revision
external help file: ModernConveniences-help.xml Module Name: ModernConveniences online version: schema: 2.0.0
Adds a timespan to DateTime values.
Add-TimeSpan [-TimeSpan] <TimeSpan> [-DateTime] <DateTime> [-ProgressAction <ActionPreference>]
[<CommonParameters>]
This is a more PowerShell-idiomatic, pipeline-based way to add a timespan to a datetime.
Get-Date |Add-TimeSpan 00:00:30
Adds 30 seconds to the current date and time value.
The TimeSpan value to add.
Type: TimeSpan
Parameter Sets: (All)
Aliases:
Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThe DateTime value to add to.
Type: DateTime
Parameter Sets: (All)
Aliases:
Required: True
Position: 2
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False{{ Fill ProgressAction Description }}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.