Set-KFSPDatetimeLocal

Syntax

Set-KFSPDatetimeLocal
  [-Item <list-item>]
  [-Field <internal-name-of-field>]
  -DateTimeLocal <datetime-value>
  [-ThrowErrors[:$true]]

Support

>= kenaflow 4.0.12

Return

In case of a missing -Field it returns the UTC value.

Description

This cmdlet can be used to convert a localized DateTime value to UTC. The command assumes that the -DateTimeLocal passed is in the time zone set on the SharePoint web regional settings.

Parameters

[-Item <list-item>]

You can specify a different list item for which you want to create a rich link. Default is the currently processed item.

[-Field <internal-name-of-field>]

Internal name of a field of the current or specified list item that is updated with the converted DateTime value.

-DateTimeLocal <datetime-value>

Required DateTime value that gets converted to UTC.

[-ThrowErrors[:$true]]

This is a default parameter for all kenaflow cmdlets. If set to $true (default!) the engine will pass exception within the cmdlet to the script for further handling.

Example

$originalValue = (Get-KFSPDatetimeLocal -Field "SomeDateTimeField")

$newValue = $originalValue.addHours(1)

Set-KFSPDatetimeLocal -Field "SomeDateTimeField" -DateTimeLocal $newValue
$item.Update()

Invoke-PnpQuery