Class CicsDateTimeHelper

java.lang.Object
com.softwaremining.vendors.cics.CicsDateTimeHelper

public class CicsDateTimeHelper extends Object
  • Field Details

    • log

      protected static transient Log log
  • Constructor Details

    • CicsDateTimeHelper

      public CicsDateTimeHelper()
  • Method Details

    • getMillis

      public static long getMillis(Eibaid eibaid)
      Translation of CICS GET ABSOLUTE TIME From: http://publib.boulder.ibm.com/infocenter/txformp/v6r0m0/index.jsp?topic=/com.ibm.cics.te.doc/erziai0024.htm ASKTIME updates the date (EIBDATE) and CICS time-of-day clock (EIBTIME) fields in the EIB. These two fields initially contain the date and time of when the task started. Refer to Appendix A, EXEC interface block (EIB) fields for details of the EIB.
      Parameters:
      eibaid -
      Returns:
    • getDateTime

      public static String getDateTime(BigDecimal millis, String format)
      Reference http://publib.boulder.ibm.com/infocenter/txformp/v6r0m0/index.jsp?topic=/com.ibm.cics.te.doc/erziai0024.htm
      Parameters:
      millis - - as returned by getAbsoluteTime
      format - - one of "YYYYMMDD" , DDMMYY, DDMMYYYY, MMDDYY, MMDDYYYY , YYDDD, YYDDMM, YYMMDD, YYYYDDMM, YYYYMMDD YYYYDDD - Specifies an eight-character field that is to receive the date in YYYYDDD format; for example, 1996/200.
      separator - - typically "-" or "/" A separator is present if requested by the DATESEP option. If no separator is requested, the returned value is left-justified in the 8-character user field. You should normally use this option only when a date is needed for output purposes. Where a date is needed for analysis, you should request the date in explicit form, for example, using the MMDDYY option.
      millis - : since 00:00 on 1 January 1900 (in milliseconds rounded to the nearest hundredth of a second).
      Returns:
      formatted date
    • getDateTime

      public static String getDateTime(double millis, String pattern)
      Reference http://publib.boulder.ibm.com/infocenter/txformp/v6r0m0/index.jsp?topic=/com.ibm.cics.te.doc/erziai0024.htm
      Parameters:
      millis - - as returned by getAbsoluteTime
      pattern - - one of "YYYYMMDD" , DDMMYY, DDMMYYYY, MMDDYY, MMDDYYYY , YYDDD, YYDDMM, YYMMDD, YYYYDDMM, YYYYMMDD YYYYDDD - Specifies an eight-character field that is to receive the date in YYYYDDD format; for example, 1996/200.
      separator - - typically "-" or "/" A separator is present if requested by the DATESEP option. If no separator is requested, the returned value is left-justified in the 8-character user field. You should normally use this option only when a date is needed for output purposes. Where a date is needed for analysis, you should request the date in explicit form, for example, using the MMDDYY option.
      millis - : since 00:00 on 1 January 1900 (in milliseconds rounded to the nearest hundredth of a second).
      Returns:
      formatted date
    • getTime

      public static String getTime(BigDecimal millis)
      From CICS Format ... TIME Returns an an eight-character String representing 24-hour clock time in the form hh:mm:ss, where the separator (shown here as :) is determined by the TIMESEP option. Documentation http://publib.boulder.ibm.com/infocenter/txformp/v6r0m0/index.jsp?topic=/com.ibm.cics.te.doc/erziai0024.htm
      Parameters:
      millis - - as returned by getAbsoluteTime
      separator - - typically "-" or "/" A separator is present if requested by the DATESEP option. If no separator is requested, the returned value is left-justified in the 8-character user field. You should normally use this option only when a date is needed for output purposes. Where a date is needed for analysis, you should request the date in explicit form, for example, using the MMDDYY option.
      Returns:
      formatted time in HH:mm:ss format
    • getTime

      public static String getTime(BigDecimal millis, String format)
    • getTime

      public static String getTime(long millis, String format)
    • getTime

      public static String getTime(double millis)
      From CICS Format ... TIME Returns an an eight-character String representing 24-hour clock time in the form hh:mm:ss, where the separator (shown here as :) is determined by the TIMESEP option. Documentation http://publib.boulder.ibm.com/infocenter/txformp/v6r0m0/index.jsp?topic=/com.ibm.cics.te.doc/erziai0024.htm
      Parameters:
      millis - - as returned by getAbsoluteTime
      separator - - typically "-" or "/" A separator is present if requested by the DATESEP option. If no separator is requested, the returned value is left-justified in the 8-character user field. You should normally use this option only when a date is needed for output purposes. Where a date is needed for analysis, you should request the date in explicit form, for example, using the MMDDYY option.
      Returns:
      formatted time in HH:mm:ss format
    • getYear

      public static long getYear(double millis)
      Parameters:
      millis -
      Returns:
      : a 32-bit binary field that is to receive the full four-digit number of the year; for example, 1990
    • getYear

      public static long getYear(BigDecimal millis)
      Parameters:
      millis -
      Returns:
      : a 32-bit binary field that is to receive the full four-digit number of the year; for example, 1990
    • getMonthOfYear

      public static int getMonthOfYear(double millis)
      Parameters:
      millis -
      Returns:
      : a 32-bit binary field that is to receive the relative month number of the year: January=1, December=12.
    • getMonthOfYear

      public static int getMonthOfYear(BigDecimal millis)
      Parameters:
      millis -
      Returns:
      : a 32-bit binary field that is to receive the relative month number of the year: January=1, December=12.
    • getDayOfWeek

      public static int getDayOfWeek(double millis)
      return the day of week
      Parameters:
      millis -
      Returns:
      : Sunday:0, Monday:1 ...
    • getDayOfWeek

      public static int getDayOfWeek(BigDecimal millis)
      return the day of week
      Parameters:
      millis -
      Returns:
      : Sunday:0, Monday:1 ...
    • getDayOfMonth

      public static int getDayOfMonth(double millis)
      return the day of Month
      Parameters:
      millis -
    • getDayOfMonth

      public static int getDayOfMonth(BigDecimal millis)
      return the day of Month
      Parameters:
      millis -
    • getDayCount

      public static int getDayCount(double millis)
      Parameters:
      millis -
      Returns:
      : a 32-bit binary field that is to receive the number of days since 1 January 1900 (day 0). This option is useful if you need to compare the current date with a previous date that has, for example, been stored in a file
    • parse

      public static long parse(String dataArea)
      analyzes three different date and time stamp formats which are commonly used on the Internet, and converts them to the ABSTIME (absolute date and time) format. ABSTIME format gives the time, in packed decimal, since 00:00 on 1 January 1900 (in milliseconds rounded to the nearest hundredth of a second). The FORMATTIME command can be used to change this into other formats. The architected date and time stamp string formats recognized by the CONVERTTIME command are:
      • RFC 1123 format The preferred standard format for date and time stamps for the HTTP protocol, as specified in RFC 1123. An example of a date and time stamp in this format is "Tue, 01 Apr 2003 10:01:02 GMT".
      • RFC 850 format An older date and time stamp format for the Internet. An example of a date and time stamp in this format is "Tuesday, 01-Apr-03 10:01:02 GMT".
      • Important: Because the year has only two digits in this format, CICS uses the assumption that the years are in the range 1970 to 2069. In the example above, CICS would assume that the date of the document was 1 April 2003. Given the date and time stamp "Thursday, 13-Feb-98 15:30:00 GMT", CICS would assume that the date of the document was 13 February 1998. Be aware of this when coding your application, if you think that you could receive date and time stamps in this format.
      • ASCtime format A date and time stamp format output from the C ASCtime function. An example of a date and time stamp in this format is "Tue Apr 1 10:01:02 2003".
      Returns: