Functions/Data/Convert-TimeZone.ps1

function Convert-TimeZone
    { 
    [cmdletbinding()]
    param
        (
        # UTC Time
        [parameter(Mandatory=$false,ValueFromPipeline=$true)]
        [Datetime]
        $InputObject = (get-date),

        # Format to express
        [Parameter(Mandatory=$False)]
        [ValidateSet("TZ","UTC")]
        [String]
        $InputFormat = "TZ",

        # Format to express
        [Parameter(Mandatory=$False)]
        [ValidateSet("TZ","UTC")]
        [String]
        $OutputFormat = "TZ",

        # Format to express
        [Parameter(Mandatory=$False)]
        [TimeZoneInfo]
        $TZ = ([System.TimeZoneInfo]::FindSystemTimeZoneById((Get-WmiObject win32_timezone).StandardName))
        )
    Process
        {
        # Switch on Formats
        if($InputFormat -eq 'TZ' -and $OutputFormat -eq 'UTC'){[System.TimeZoneInfo]::ConvertTimeBySystemTimeZoneId($InputObject,"Greenwich Standard Time")}
        elseif($InputFormat -eq 'UTC' -and $OutputFormat -eq 'TZ'){[System.TimeZoneInfo]::ConvertTimeFromUtc($InputObject, $TZ)}
        else {$InputObject}        
        }
    }