KB: FlashArray Timestamp Format Values
Timestamp Differences
Depending on the SDK version and build number, the timestamp that is returned could be in one of three different formats. Each affected SDK version and build is shown below along with the default format that is returned.
SDK Version | Build | Timestamp Format | Example Output |
---|
1 |
1.13.2.412 and earlier |
Local time zone offset |
7/23/2020 3:14:45 PM |
1 |
1.16.425 and later |
UTC |
7/23/2020 8:14:48 PM |
2 |
2.2.272 and later |
Local time zone offset |
7/23/2020 3:14:45 PM |
Applies to
FlashArray PowerShell SDK version 1.13.0.3 and later with PowerShell versions 5.1 and 7.x or later.
Cause
The cause is due to code changes to the Purity API and how timestamp values are returned to the SDK, as well the changes of internal date and time formatting between PowerShell versions 5.1 and 7.x and later.
Resolution
By setting time variables, as described by Microsoft in this documentation, in a PowerShell script, you can define various time formats that are returned.
As an example, by running this code in SDK version 1.13, the timestamp returned will be in 24-hour format local time with the offset:
$currentThread = [System.Threading.Thread]::CurrentThread
$culture = $CurrentThread.CurrentCulture.Clone()
$culture.DateTimeFormat.LongTimePattern = 'HH:mm:ssK'
$currentThread.CurrentCulture = $culture
$v = Get-PfaVolume $array -name a1
$v
Running the same code in SDK version 1 build 1.16.425 or later will return the array time in 24-hour UTC (Z) format.
Finally, running the following code with SDK version 2.2 or later will return the data below:
$currentThread = [System.Threading.Thread]::CurrentThread
$culture = $CurrentThread.CurrentCulture.Clone()
$culture.DateTimeFormat.LongTimePattern = 'HH:mm:ssK'
$currentThread.CurrentCulture = $culture
$v = Get-Pfa2Volume -Array $array -Name a1
$v
Additional Information
Microsoft documentation: Custom date and time format strings