Class SapDateTimeAdapter


  • public class SapDateTimeAdapter
    extends Object
    Adapter for converting date and time fields in SAP format to DateTimeZone
    • Constructor Detail

      • SapDateTimeAdapter

        public SapDateTimeAdapter()
    • Method Detail

      • toDateTimeZone

        public static DateTimeZone toDateTimeZone​(String sapDateTime,
                                                  TimeZone timeZone)
        Convert a SAP time stamp in the format YYYYMMDDHHMMSS to an instance of DateTimeZone
        Parameters:
        sapDateTime - time stamp in the format YYYYMMDDHHMMSS
        timeZone - time zone of the SAP time stamp
        Returns:
        instance of DateTimeZone
      • toDateTimeZone

        public static DateTimeZone toDateTimeZone​(String sapDate,
                                                  String sapTime,
                                                  TimeZone timeZone)
        Convert SAP date in the format YYYYMMDD and time in the format HHMMSS to an instance of DateTimeZone
        Parameters:
        sapDate - date in the format YYYYMMDD
        sapTime - time in the format HHMMSS
        timeZone - time zone of the SAP time stamp
        Returns:
        instance of DateTimeZone
      • toSapDate

        public static String toSapDate​(DateTimeZone dtz)
        Convert an instance of DateTimeZone to SAP date in the format YYYYMMDD
        Parameters:
        dtz - instance of DateTimeZone
        Returns:
        SAP date in the format YYYYMMDD
      • toSapTime

        public static String toSapTime​(DateTimeZone dtz)
        Convert an instance of DateTimeZone to SAP time in the format HHMMSS
        Parameters:
        dtz - instance of DateTimeZone
        Returns:
        SAP time in the format HHMMSS
      • toSapDateTime

        public static String toSapDateTime​(DateTimeZone dtz)
        Convert an instance of DateTimeZone to SAP time stamp in the format YYYYMMDDHHMMSS
        Parameters:
        dtz - instance of DateTimeZone
        Returns:
        SAP time stamp in the format YYYYMMDDHHMMSS