Micro Focus Frequent Contributor
Micro Focus Frequent Contributor
443 views

Date Format conversion is not working as expected using Date Parser

Jump to solution

Hi All,

                I have a requirement where I need to convert the date format in order to populate them in SNOW ticket . I need to convert date incoming in as 12-hour format to 24-hour format . I’m using Library/Utility Operations/Date and Time/Date Parser operation from Base 1.11.0 content in OO 10.80 . I have 3 scenarios mentioned below :

  1. This works as expected . Input is 20180720 023000 and output is 2018-07-20 12:30:00 .  Attahcment date1.jpg
  2. This didn’t work as expected . Input is 20180720 123000 and output should have been 2018-07-20 12:30:00 but it returned 2018-07-20 00:30:00 . Attachment date2.jpg
  3. This also works as expected . Input is 20180720 223000 and output is 2018-07-20 22:30:00 . Attachment date3.jpg

Has anyone come across this ? or is this a known issue ?

Can we overcome this by using the latest Base content pack ?

0 Likes
1 Solution

Accepted Solutions
Outstanding Contributor.. JarodMB Outstanding Contributor..
Outstanding Contributor..

Re: Date Format conversion is not working as expected using Date Parser

Jump to solution

The problem is on input - it sees the value as an AM because the AM/PM marker is not specified 
add PM to your input timestamp, aa to your input format
i.e.
  20180720 123000 PM
  yyyyMMdd hhmmss aa

you can remove aa from your output as you're exporting to 24 hour format

3 Replies
Outstanding Contributor.. JarodMB Outstanding Contributor..
Outstanding Contributor..

Re: Date Format conversion is not working as expected using Date Parser

Jump to solution

You're using a 12-hour mask value which relies on an am/pm marker - because the marker is missing it sees the value as being am

0 Likes
Micro Focus Frequent Contributor
Micro Focus Frequent Contributor

Re: Date Format conversion is not working as expected using Date Parser

Jump to solution

hi Jarod,

i tried that also but same issue . Attachment date4.jpg

 

0 Likes
Outstanding Contributor.. JarodMB Outstanding Contributor..
Outstanding Contributor..

Re: Date Format conversion is not working as expected using Date Parser

Jump to solution

The problem is on input - it sees the value as an AM because the AM/PM marker is not specified 
add PM to your input timestamp, aa to your input format
i.e.
  20180720 123000 PM
  yyyyMMdd hhmmss aa

you can remove aa from your output as you're exporting to 24 hour format

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.