Get-KFSPDatetimeLocal

Syntax

Get-KFSPDatetimeLocal
  [-Item <list-item>]
  -Field <internal-name-of-field>
  [-ThrowErrors[:$true]]

Get-KFSPDatetimeLocal
  [-Item <list-item>]
  -DateTimeUtc <datetime-in-utc>
  [-ThrowErrors[:$true]]

Support

>= kenaflow 4.0.12

Return

A localized DateTime value based on the SharePoint web regional setting.

Description

This cmdlet can be used to convert the UTC datetime value in a SharePoint list item field to the localized DateTime value as it was entered or is viewed by the user.

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.

[-Anonymous[:$false]]

if specified the link will point to a http endpoint that does not require authentication. The user is unknown to the workflow in this case.

-DateTimeUtc <datetime-in-utc>

Instead of specifying a field you can specify a DateTime value that will be converted to a localized DateTime value.

[-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

Discussion