COREDATETIMELIB
Use the COREDATETIMELIB function library to calculate date time operations to be used as test data inputs in a component of a flow. The library also has date time conversion functions to format the date time.
This section provides a list of functions in the library, along with the usage details.
getCurrentDatetimeWithGivenDateFormat
Gets the current date and time in the specified format and stores it into a global variable specified in the OP Variable Name column.
Usage:
getCurrentDateTimeWithGivenDateFormat(String dFormat) dFormat- Java date formats are supported. getCurrentDateTimeWithGivenDateFormat("mm-dd-yyyy:hh.mm.ss")
 
Input Parameters:
Date Format String
Return Type: String
getFormattedDateWithGivenDate
Converts the date time input provided in to the specified format and stores it into a global variable specified in the OP Variable Name column.
Usage:
getFormattedDateWithGivenDate(String sourceDatetime, String sourceDateFromat, String outputDateFormat)
 
dFormat- Java date formats are supported
 
getFormattedDateWithGivenDate ("02/01/2020:23:00:00","dd/mm/ YYYY:HH24:mi:ss","mm-dd-yyyy:hh.mi.ss")
getDateDiffInSecsWithGivenDateFormat
Takes a start date and end data and the corresponding data format as input parameters and calculates the difference between the dates in seconds and stores it into a global variable specified in the OP Variable Name column.
Example:
getDateDiffInSecsWithGivenDateFormat(String dateStart, String dateEnd, String dFormat)
 
getDateDiffInSecsWithGivenDateFormat("12-13-2014", "12-29-2014", "mm-dd-yyy")
 
Input Parameters:
String dateStart, String dateEnd, String dFormat
Return Type: String
getAdjustedTimeWithGivenDateTime
Calculates a date based on the specified date and an offset (adds or subtracts to the specified date) along with the dateformat, gets the adjusted time and stores it into a global variable specified in the OP Variable Name column.
Note: Supports the offset in hours:minutes:seconds = hh:mm:ss.
Example:
getAdjustedTimeWithGivenDateTime(String dateTime, String offset, String dFormat)
 
getAdjustedTimeWithGivenDateTime("12-13-2014", "-02:30","mm-dd- yyyy")
 
Input Parameters:
String dateTime, String offset, String dFormat
Return Type: String
getAdjustedTimeWithCurrentDateTime
Calculates the date and time after adding the specified offset to the current date and time in the specified date/time format and stores it into a global variable specified in the OP Variable Name column.
Usage:
getAdjustedTimeWithCurrentDateTime(String offset, String dFormat)
 
getAdjustedTimeWithCurrentDateTime("-2.30", "mm-dd-yyyy")
 
Input Parameters:
String offset, String dFormat
Return Type: String
addDaysToCurrentDateWithGivenFormat
Calculates the date and time after adding the specified number of days to current date and time in the specified date/time format and stores it into a global variable specified in the OP Variable Name column.
Usage:
addDaysToCurrentDateWithGivenFormat(String noOfDays, String dFormat)
addDaysToCurrentDateWithGivenFormat("45", "mm-dd-yyyy")
 
Input Parameters:
String noOfDays, String dFormat
Return Type: String
getCurrentTimeinMilliSeconds
Gets the current date time in milliseconds and stores it into a global variable specified in the OP Variable Name column.
Usage:
getCurrentDateTimeinMilliSeconds()
 
Input Parameters: None
Return Type: String
getEpochInGivenDateTimeFormat
Supports the conversion of the date time value from epoch format, which is the format used for incrementer in the subroutine looping interface, when user selects the incrementer type as date time.
This function takes two parameters, the first is the name of the variable that has the timestamp in epoch (example: incrementer in sub-routine loop), and the second is a valid date-time output format. It returns a string with the date-time in the format specified.and stores it into a global variable specified in the OP Variable Name column.
Usage:
getEpochInGivenDateTimeFormat(String epochDateTime, String outputDateFormat)
 
Input Parameters:
epochDateTime - The epoch that needs to be converted outputDateFormat - The format of the date to be output by the function
Return Type: String
getNthDayOfCurrentMonth
Calculates and returns the date for Nth day of the current month based on the input date format and day of the month.
Usage:
getNthDayOfCurrentMonth(String dFormat, String noOfDays)
getNthDayOfCurrentMonth("yy-MM-dd", "15")
 
Input Parameters:
dFormat - Format of the output date
noOfDays - Day of the month for which the date has to be calculated
getNthDayOfCurrentYear
Calculates and returns the date for Nth day of the current year based on the input date format and day of the year.
Usage:
getNthDayOfCurrentMonth(String dFormat, String noOfDays)
getNthDayOfCurrentMonth("yy-MM-dd", "45")
 
Input Parameters:
dFormat - Format of the output date