Class DateFormats

java.lang.Object
br.ufsc.labsec.utils.DateFormats

public class DateFormats
extends Object
  • Field Summary

    Fields
    Modifier and Type Field Description
    static org.apache.commons.lang3.time.FastDateFormat DMY_DATE_FORMAT
    Formato: dd/MM/yyyy
    static org.apache.commons.lang3.time.FastDateFormat DMY_DATE_FORMAT_NO_SLASH
    Formato: ddMMyyyy
    static org.apache.commons.lang3.time.FastDateFormat GMT_DATE_TIME_FORMAT
    Formato: yyyy-MM-dd'T'HH:mm:ss
    static org.apache.commons.lang3.time.FastDateFormat GMT_YODA_TIME_FORMAT
    Formato: yyyy-MM-dd HH:mm:ss
    static org.apache.commons.lang3.time.FastDateFormat ISO_DATE_FORMAT
    Formato: yyyy-MM-dd
    static org.apache.commons.lang3.time.FastDateFormat ISO_DATE_FORMAT_NO_SLASH
    Formato: yyyyMMdd
    static org.apache.commons.lang3.time.FastDateFormat LPA_ASN1_DATE_FORMAT
    Formato: yyyyMMddHHmmss
    static org.apache.commons.lang3.time.FastDateFormat LPA_ASN1_SHORT_DATE_FORMAT
    Formato: yyMMddHHmmss
    static org.apache.commons.lang3.time.FastDateFormat REPORT_DATE_FORMAT
    Formato: dd/MM/yyyy HH:mm:ss zzz
    static org.apache.commons.lang3.time.FastDateFormat TIMESTAMP_FORMAT
    Formato: dd/MM/yyyy HH:mm:ss z
    static org.apache.commons.lang3.time.FastDateFormat UTC_SIGNING_TIME_FORMAT
    Formato: yyyy-MM-dd'T'HH:mm:ss'Z' Timezone: UTC
    static org.apache.commons.lang3.time.FastDateFormat XML_DATE_FORMAT
    Formato: yyyy-MM-dd'T'HH:mm:ss.SSS
    static org.apache.commons.lang3.time.FastDateFormat ZIP_DATE_TIME_FORMAT
    Formato: yyyy-MM-dd'T'HH:mm:ss.SSSZ
  • Constructor Summary

    Constructors
    Constructor Description
    DateFormats()  
  • Method Summary

    Modifier and Type Method Description
    static Date parse​(String date, org.apache.commons.lang3.time.FastDateFormat... formatsOptions)
    Tentar fazer o parsing da data com os formatos especificados

    Methods inherited from class java.lang.Object

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

    • UTC_SIGNING_TIME_FORMAT

      public static final org.apache.commons.lang3.time.FastDateFormat UTC_SIGNING_TIME_FORMAT
      Formato: yyyy-MM-dd'T'HH:mm:ss'Z' Timezone: UTC
    • REPORT_DATE_FORMAT

      public static final org.apache.commons.lang3.time.FastDateFormat REPORT_DATE_FORMAT
      Formato: dd/MM/yyyy HH:mm:ss zzz
    • ISO_DATE_FORMAT

      public static final org.apache.commons.lang3.time.FastDateFormat ISO_DATE_FORMAT
      Formato: yyyy-MM-dd
    • ISO_DATE_FORMAT_NO_SLASH

      public static final org.apache.commons.lang3.time.FastDateFormat ISO_DATE_FORMAT_NO_SLASH
      Formato: yyyyMMdd
    • ZIP_DATE_TIME_FORMAT

      public static final org.apache.commons.lang3.time.FastDateFormat ZIP_DATE_TIME_FORMAT
      Formato: yyyy-MM-dd'T'HH:mm:ss.SSSZ
    • GMT_DATE_TIME_FORMAT

      public static final org.apache.commons.lang3.time.FastDateFormat GMT_DATE_TIME_FORMAT
      Formato: yyyy-MM-dd'T'HH:mm:ss
    • GMT_YODA_TIME_FORMAT

      public static final org.apache.commons.lang3.time.FastDateFormat GMT_YODA_TIME_FORMAT
      Formato: yyyy-MM-dd HH:mm:ss
    • XML_DATE_FORMAT

      public static final org.apache.commons.lang3.time.FastDateFormat XML_DATE_FORMAT
      Formato: yyyy-MM-dd'T'HH:mm:ss.SSS
    • TIMESTAMP_FORMAT

      public static final org.apache.commons.lang3.time.FastDateFormat TIMESTAMP_FORMAT
      Formato: dd/MM/yyyy HH:mm:ss z
    • LPA_ASN1_DATE_FORMAT

      public static final org.apache.commons.lang3.time.FastDateFormat LPA_ASN1_DATE_FORMAT
      Formato: yyyyMMddHHmmss
    • LPA_ASN1_SHORT_DATE_FORMAT

      public static final org.apache.commons.lang3.time.FastDateFormat LPA_ASN1_SHORT_DATE_FORMAT
      Formato: yyMMddHHmmss
    • DMY_DATE_FORMAT

      public static final org.apache.commons.lang3.time.FastDateFormat DMY_DATE_FORMAT
      Formato: dd/MM/yyyy
    • DMY_DATE_FORMAT_NO_SLASH

      public static final org.apache.commons.lang3.time.FastDateFormat DMY_DATE_FORMAT_NO_SLASH
      Formato: ddMMyyyy
  • Constructor Details

    • DateFormats

      public DateFormats()
  • Method Details

    • parse

      public static Date parse​(String date, org.apache.commons.lang3.time.FastDateFormat... formatsOptions) throws ParseException
      Tentar fazer o parsing da data com os formatos especificados
      Parameters:
      date - A data a ser parseada
      formatsOptions - Os formatos a serem usados
      Returns:
      A data ou Optional.empty() caso nenhum formato tenha funcionado
      Throws:
      ParseException