java.lang.Object
com.atlassian.jira.functest.framework.util.date.DateUtil

public class DateUtil extends Object

Some utility methods for manipulating dates in functional tests.

This is often required to make sure that func tests run okay when executed in different time zones.

Since:
v4.1
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    dateAsMillis(int year, int month, int day, int hour, int minute)
    Returns a string representing the given date in milliseconds, for example 123456789.
    static String
    dateAsTimestamp(int year, int month, int day, int hour, int minute)
    Returns a string representing the given date in the format suitable for timestamp fields in the data XML file, for example 2008-06-02 09:43:58.788.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • DateUtil

      public DateUtil()
  • Method Details

    • dateAsTimestamp

      public static String dateAsTimestamp(int year, int month, int day, int hour, int minute)

      Returns a string representing the given date in the format suitable for timestamp fields in the data XML file, for example 2008-06-02 09:43:58.788.

      Parameters:
      year - year
      month - month
      day - day
      hour - hour
      minute - minute
      Returns:
      String timestamp representation
    • dateAsMillis

      public static String dateAsMillis(int year, int month, int day, int hour, int minute)

      Returns a string representing the given date in milliseconds, for example 123456789.

      Parameters:
      year - year
      month - month
      day - day
      hour - hour
      minute - minute
      Returns:
      String millisecond representation