Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Analytics and Notifications for PI System Explorer (PI Server 2018)

ParseTime

  • Last UpdatedJan 11, 2023
  • 1 minute read

Translate a PI time expression to a timestamp. Use regular time expression inside single quotes for better performance.

Syntax

ParseTime(s1)

Arguments

  • s1

    A character string or an array of strings in PI time format, enclosed in double quotes

Returns

The timestamp corresponding to s1

Exceptions

If s1 is not a character string, or if there is a syntax error, returns an error value.

If the array does not consist of strings in a time format, returns an error.

Notes

Use of the time expression '01-Jan-2018' over the string "01-Jan-2018" is strongly recommended.

Example

  • ParseTime(Concat("12", "-31", "-16"))

    [Returns 12/31/2016 12:00:00 AM, which is the same as '12/31/16']

  • ParseTime("14-Dec-16")

    [Renders the same result as '14-Dec-16'. Use only when string operations are necessary]

  • ParseTime("*")

    [Renders the same result as '*'. Use only when string operations are necessary]

  • ParseTime(Variable1)

    Name

    Expression

    Value at Evaluation

    Variable1

    'TimeStringArray'

    [t, t+3h, t+14h]

    Variable 2

    ParseTime(Variable1)

    [3/14/2018 12:00:00 AM, 3/14/2018 3:00:00 AM, 3/14/2018 2:00:00 PM]

    [Renders the array results in a proper PI Time format, assuming today is 3/14/18]

In This Topic
TitleResults for “How to create a CRG?”Also Available in