Class DateUtil


  • public final class DateUtil
    extends java.lang.Object
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.TimeZone UTC  
    • Constructor Summary

      Constructors 
      Constructor Description
      DateUtil()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.text.SimpleDateFormat createIso8601Format()  
      static java.text.SimpleDateFormat createRfc2822Format()  
      static java.lang.String formatIso8601​(java.util.Date date)
      Format a date to in ISO 8601 format (as used by GIT) adjusted to UTC timezone.
      static java.lang.String formatRfc2822​(java.util.Date date)
      Format a date to in RFC 2822 format (as used by GIT) adjusted to UTC timezone.
      static java.util.Date parseIso8601​(java.lang.String rawstr)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • UTC

        public static final java.util.TimeZone UTC
    • Constructor Detail

      • DateUtil

        public DateUtil()
    • Method Detail

      • createIso8601Format

        public static java.text.SimpleDateFormat createIso8601Format()
      • createRfc2822Format

        public static java.text.SimpleDateFormat createRfc2822Format()
      • formatIso8601

        public static java.lang.String formatIso8601​(java.util.Date date)
        Format a date to in ISO 8601 format (as used by GIT) adjusted to UTC timezone.
      • formatRfc2822

        public static java.lang.String formatRfc2822​(java.util.Date date)
        Format a date to in RFC 2822 format (as used by GIT) adjusted to UTC timezone.
      • parseIso8601

        public static java.util.Date parseIso8601​(java.lang.String rawstr)
                                           throws java.text.ParseException
        Throws:
        java.text.ParseException