raja777m Regular Contributor.
Regular Contributor.
242 views

sysdate+ x hours for a variable

Hello, I have a variable in the flow, which needs to have sysdate as Start date/time and sysdate + X(read the value from database/previous variables) for end date/time.

For example:

TimePeriod = 6 (represents 6 hours)

StartDate = systemDate (06/26/2017 10:00; in this format)

EndDate = StartDate + TimePeriod (result should be 06/26/2017 16:00)

All in CST timezone.

 

Thanks in advance.

0 Likes
3 Replies
Established Member.. Gontran
Established Member..

Re: sysdate+ x hours for a variable

Hello

We do have date operations to format dates so you just have to append the information to the variable. you may want to give a try and let us know if that works for you.

 

raja777m Regular Contributor.
Regular Contributor.

Re: sysdate+ x hours for a variable

Hello, I tried 

Base(Content pack)> Library> Utility Operations>Date and Time.

 

The issues I'm running into, with "Date Parser":

format I used:

en, unix, dd/MM/yyyy HH:mm

 

 

format I need(24 hr format):

 

06/26/2017 18:00

 

 

error:

 java.lang.IllegalArgumentException: Illegal pattern character 'e';

 

Is there a way to define the format I want, using the get and offset d&t itself?

In java, this format, in 24hr, I believe:

String DateToStr = DateFormat.getInstance().format(curDate);
System.out.println(DateToStr);

Thanks.

 

0 Likes
AndreiTruta Outstanding Contributor.
Outstanding Contributor.

Re: sysdate+ x hours for a variable

You can use the Offset operation to increase with 6 hours and Date parser to parse it according to the needs. just remove en. unix.

Screenshot below: got current date, increased with 1 hour and formatted to the desire format.Screenshot_56.png

 

 

 

 

 

 

 

 

 

 

Hope it helps

Andrei Vasile Truta
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.