Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
This repository was archived by the owner on Apr 12, 2021. It is now read-only.

ConnectWise time normalization #40

Description

@mrmarkwest

In trying to do a Create-CWConfig function, I ran into this terrible annoyance with the way that CW needs to receive [datetime] via the API. I wrote this little function that helps. Figured it would help you and your users so they didn't bang their head against the same problems I did.

function ConvertTo-CWTime
{
Param
(
[Parameter(Mandatory = $True,Position = 0)]
[datetime]$dateTime
)
$MyTZone = Get-TimeZone
$datetime = "{0:yyyy-MM-ddThh:mm:ssZ}" -f [System.TimeZoneInfo]::ConvertTimeToUtc($dateTime, $MyTZone)
return $datetime
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions