-
-
Notifications
You must be signed in to change notification settings - Fork 113
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b30200b
commit 6365005
Showing
11 changed files
with
447 additions
and
27 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,115 @@ | ||
--- | ||
external help file: PSScriptTools-help.xml | ||
Module Name: PSScriptTools | ||
online version: | ||
schema: 2.0.0 | ||
--- | ||
|
||
# Convertto-LocalTime | ||
|
||
## SYNOPSIS | ||
|
||
Convert a foreign time to local | ||
|
||
## SYNTAX | ||
|
||
```yaml | ||
Convertto-LocalTime [-Datetime] <DateTime> [-UTCOffset] <TimeSpan> [<CommonParameters>] | ||
``` | ||
|
||
## DESCRIPTION | ||
|
||
It can be tricky sometimes to see a time in a foreign location and try to figure out what that time is locally. This command attempts to simplify this process. In addition to the remote time, you need the base UTC offset for the remote location. You can use Get-Timezone to help. See examples. | ||
|
||
## EXAMPLES | ||
|
||
### Example 1 | ||
|
||
```powershell | ||
PS C:\> ConvertTo-LocalTime "3/15/2019 7:00AM" 8:00:00 | ||
Thursday, March 14, 2019 7:00:00 PM | ||
``` | ||
|
||
Convert a time that is in Singapore to local (Eastern) time. | ||
|
||
### Example 2 | ||
|
||
```powershell | ||
PS C:\> get-timezone -ListAvailable | where id -match hawaii | ||
Id : Hawaiian Standard Time | ||
DisplayName : (UTC-10:00) Hawaii | ||
StandardName : Hawaiian Standard Time | ||
DaylightName : Hawaiian Daylight Time | ||
BaseUtcOffset : -10:00:00 | ||
SupportsDaylightSavingTime : False | ||
PS C:\> ConvertTo-LocalTime "10:00AM" -10:00:00 | ||
Thursday, March 14, 2019 4:00:00 PM | ||
``` | ||
|
||
In this example, the user if first determining the UTC offset for Hawaii. Then 10:00AM in say Honolulu, is converted to local time which in this example is in the Eastern Time zone. | ||
|
||
## PARAMETERS | ||
|
||
### -Datetime | ||
|
||
Enter a non-local date time | ||
|
||
```yaml | ||
Type: DateTime | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: 0 | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### -UTCOffset | ||
Enter the location's' UTC Offset. You can use Get-Timezone to discover it. | ||
```yaml | ||
Type: TimeSpan | ||
Parameter Sets: (All) | ||
Aliases: | ||
|
||
Required: True | ||
Position: 1 | ||
Default value: None | ||
Accept pipeline input: False | ||
Accept wildcard characters: False | ||
``` | ||
### CommonParameters | ||
This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. | ||
For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216). | ||
## INPUTS | ||
### None | ||
## OUTPUTS | ||
### DateTime | ||
## NOTES | ||
Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ | ||
## RELATED LINKS | ||
[Get-TimeZone]() | ||
[Get-MyTimeInfo]() | ||
[ConvertFrom-UTCTime]() | ||
[ConvertTo-UTCTime]() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.