matteo.stettner Respected Contributor.
Respected Contributor.
503 views

Timestamp parsing of non-standard time zone information

Hello,

Upfront; non-standard time zone is meant for a time zone statement that is not covered by the FlexConnector DevGuide.

To the problem
I have to parse a time stamp that looks the following: 2017-06-08T06:24:03.630+02:00

The parsing until the milliseconds is rather straight forward: yyyy-MM-dd'T'hh:mm:ss.SSS
However the time zone gives me some headaches. By definition in the DevGuide the time zone should be written in this example in either of those variants:

  1. +0200
  2. GMT +02:00

In this situation we have:

  1. A doublepoint
  2. No PST/GMT statement

Hence none of the Z or z version works for me. Is there any possibilty to still parse it?

Labels (2)
Tags (1)
0 Likes
3 Replies
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: Timestamp parsing of non-standard time zone information

not tested, but i think you get the approach...

 

__parseMultipleTimeStamp(__concatenate(__regexToken(Date_String,"(\\d+-\\d+-\\d+T\\d+:\\d+:\\d+.\\d+)" ), "GMT", __regexToken(Date_String,"\\+"\\d+:\\d+)),"yyyy-MM-dd'T'hh:mm:ss.SSS z")

 

0 Likes
Acclaimed Contributor.. Shaun Acclaimed Contributor..
Acclaimed Contributor..

Re: Timestamp parsing of non-standard time zone information

That format should more-or-less work out-of-the-box. That being said, the SmartConnector supports the Java SimpleDateFormat syntax, so refer to the Java SimpleDateFormat manpage for examples.
0 Likes
Highlighted
Knowledge Partner Knowledge Partner
Knowledge Partner

Re: Timestamp parsing of non-standard time zone information

not sure, if X is suported...

https://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html

- z
-- Time zone General time zone
-- Pacific Standard Time; PST; GMT-08:00


- Z
-- Time zone RFC 822 time zone
-- "-800"


- X
-- Time zone ISO 8601 time zone
-- "-08; -0800; -08:00"

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.