Absent Member.
Absent Member.
662 views

Time in flexconnector

Jump to solution

I've built a flexconnector for Microsoft Direct Access, (my first) and its working well, parsing the fields I need except for time. (This is a sdkfilereader.)

Here's the time from  the DA log:

2/1/2016 10:28:12 PM

Here's from esm endtime field

esm.JPG

As you can see, in ESM it's not adjusting for PM.

From my sdkfilereader.properties  file

Here's the token:

token[6].name=ConnectionStartTime

token[6].type=String

Here's the event:

event.endTime=__createOptionalTimeStampFromString(ConnectionStartTime,MM/dd/yyyy HH:mm:ss a)

Any ideas what I'm missing?  I thought the "a" took care of am/pm.

Thanks

Labels (3)
0 Likes
1 Solution

Accepted Solutions
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class

The key here is to change the 'HH' to 'hh'

View solution in original post

0 Likes
5 Replies
Fleet Admiral
Fleet Admiral

What you have there looks right (you may need to escape the colons as below), is there any reason you aren't declaring the token as a timestamp to begin with?

token[6].name=ConnectionStartTime

token[6].type=TimeStamp

token[6].format=MM/dd/yyyy HH\:mm\:ss a

0 Likes
Absent Member.
Absent Member.

Thanks Richard.

As you suggested  I added the back slashes to the event like so:

event.endTime=__createOptionalTimeStampFromString(ConnectionStartTime,MM/dd/yyyy HH\:mm\:ss a)

but the end time still is not reflecting PM after the change: 1 Feb 2016 10:26:18 EST

I originally had the token as a TimeStamp but it did not parse at all. Endtime just showed  FlexConnector test machine time (DA log events are from January-Feb)  just a minute or two removed from the manager receipt time.

Here's the format line as I originally used it:

token[6].format=MM/dd/yyyy HH:mm:ss a

Thanks again!

0 Likes
Micro Focus Expert
Micro Focus Expert

What happens if you map the value to a different timestamp field?

event.deviceCustomDate1=__createOptionalTimeStampFromString(ConnectionStartTime,MM/dd/yyyy HH\:mm\:ss a)

0 Likes
Cadet 2nd Class Cadet 2nd Class
Cadet 2nd Class

The key here is to change the 'HH' to 'hh'

View solution in original post

0 Likes
Absent Member.
Absent Member.

Hey Art.

It worked!

1 Feb 2016 22:26:18 EST

Thanks so much.

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.