SharePoint designer 2013 workflow date time format

My scenario : get the date format value from http web service call.

The date/time format is ISO format such as “2017-08-10T17:36:12Z”

Actual local time(Perth) is 11/08/2017 1:36:12.

However when I tried to save the field value as Date/Time workflow variable, exception happens like below error message.

The conversion could not be completed because the supplied DateTime did not have the Kind property set correctly. For example, when the Kind property is DateTimeKind.Local, the source time zone must be TimeZoneInfo.Local

Without the last character ‘Z’ is working to conversion and set the date/time variable.

  • Copy from [StrOriginalISOFormatWithZ], starting at 0 for 19 characters(Output to [StrTempISOFormatWithoutZ])
    • [StrOriginalISOFormatWithZ] : 2017-08-10T17:36:12Z
    • [StrTempISOFormatWithoutZ] : 2017-08-10T17:36:12
  • Set [DateTimeTmpVariable] to [StrTempISOFormatWithouZ]
    • [DateTimeTmpVariable] : 2017-08-10T09:36:12Z
  • Add 0 months, 0 days, 8 hours, 0 minutes to [DateTimeTmpVariable](Output to [DateTimeFinalVariable])
    • [DateTimeFinalVariable] : 2017-08-10T17:36:12Z

 

Date/Time Output format example

  • As String           : 11/08/2017 1:36:12 AM
  • ISO Formatted : 2017-08-10T17:36:12Z
  • Long Date  : Friday, 11 August 2017
  • Long Time : 1:36:12 AM
  • ShortDate  : 11/08/2017
  • ShortTime : 1:36 AM

 

Get Time Zone information for SharePoint site. (get Bias value)

[SharePointSiteURL]/_api/web/RegionalSettings/TimeZone

d/Information/Bias

{
“d”: {
“__metadata”: {
“id”: “[SharePointSiteURL]/_api/web/RegionalSettings/TimeZone”,
“uri”: “[SharePointSiteURL]/_api/web/RegionalSettings/TimeZone”,
“type”: “SP.TimeZone”
},
“Description”: “(UTC+08:00) Perth”,
“Id”: 73,
“Information”: {
“__metadata”: {
“type”: “SP.TimeZoneInformation”
},
“Bias”: -480,
“DaylightBias”: -60,
“StandardBias”: 0
}
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: