Package com.cyara.utilities
Class UtilsTime
java.lang.Object
com.cyara.utilities.UtilsTime
public class UtilsTime
extends java.lang.Object
Various methods used throughout the samples for processing time.
This is not an official Cyara product and is not officially supported. It is used for demonstration and training purposes. For assistance, contact chris.ryan@cyara.com
- Version:
- 1.0
- Author:
- Chris Ryan
-
Constructor Summary
Constructors Modifier Constructor Description private
UtilsTime()
Instantiates a new UtilsTime. -
Method Summary
Modifier and Type Method Description static java.util.Date
getFirstDayOfLastQuarter()
Finds the first date of the last quarter for a given date.static java.util.Date
getFirstDayOfThisQuarter(java.util.Date date)
Finds the first date of the quarter for a given date.static java.util.Date
getFirstDayOfThisYear(java.util.Date date)
Finds the first date of the year for a given datestatic java.util.Date
getLastDayOfLastQuarter()
Finds the last date of the last quarter for a given date.static java.util.Date
getLastDayOfThisQuarter(java.util.Date date)
Finds the last date of the quarter for a given date.static int
getMillis(java.lang.String responseTime)
Convert the step response time from the API format into the number of milliseconds that represents.static long
getUTCTicks(java.util.Date date)
Converts a given date into time since C#-friendly epoch
-
Constructor Details
-
UtilsTime
private UtilsTime()Instantiates a new UtilsTime. Private to prevent instantiation.
-
-
Method Details
-
getMillis
public static int getMillis(java.lang.String responseTime)Convert the step response time from the API format into the number of milliseconds that represents.- Parameters:
responseTime
- The API format of a step response time- Returns:
- The response time in milliseconds
- Since:
- 1.0
-
getUTCTicks
public static long getUTCTicks(java.util.Date date)Converts a given date into time since C#-friendly epoch- Parameters:
date
- The provided date- Returns:
- The C# time since epoch
- Since:
- 1.0
-
getFirstDayOfThisQuarter
public static java.util.Date getFirstDayOfThisQuarter(java.util.Date date)Finds the first date of the quarter for a given date.- Parameters:
date
- The provided date- Returns:
- The first date
- Since:
- 1.0
-
getLastDayOfThisQuarter
public static java.util.Date getLastDayOfThisQuarter(java.util.Date date)Finds the last date of the quarter for a given date.- Parameters:
date
- The provided date- Returns:
- The last date
- Since:
- 1.0
-
getFirstDayOfLastQuarter
public static java.util.Date getFirstDayOfLastQuarter()Finds the first date of the last quarter for a given date.- Returns:
- The first date
- Since:
- 1.0
-
getLastDayOfLastQuarter
public static java.util.Date getLastDayOfLastQuarter()Finds the last date of the last quarter for a given date.- Returns:
- The first date
- Since:
- 1.0
-
getFirstDayOfThisYear
public static java.util.Date getFirstDayOfThisYear(java.util.Date date)Finds the first date of the year for a given date- Parameters:
date
- The provided date- Returns:
- The first date
- Since:
- 1.0
-