Skip to content

Instantly share code, notes, and snippets.

@OlafD
Created August 12, 2020 09:06
Show Gist options
  • Save OlafD/6b56f86e5b1c858e00b33418b1170e36 to your computer and use it in GitHub Desktop.
Save OlafD/6b56f86e5b1c858e00b33418b1170e36 to your computer and use it in GitHub Desktop.
For using a datetime value in a SharePoint Caml Query, the value needs to be fomatted in the right way. The next two lines will help on this, when it is needed in PowerShell, should also help for C# code.
$date = Get-Date
$zulu = $date.ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment