Class ConvertDate

java.lang.Object
net.minidev.asm.ConvertDate

public class ConvertDate extends Object
Utility class for converting strings into Date objects, considering various global date formats. It handles different month and day names across languages, and supports timezone adjustments.
  • Field Details

    • defaultTimeZone

      public static TimeZone defaultTimeZone
      Default TimeZone used for date conversions. Can be overwritten to change the default time zone.
  • Constructor Details

    • ConvertDate

      public ConvertDate()
      default constructor
  • Method Details

    • getMonth

      public static Integer getMonth(String month)
      Retrieves the month's integer representation based on the provided month name.
      Parameters:
      month - the name of the month
      Returns:
      the integer value of the month, or null if the month name is unrecognized
    • convertToDate

      public static Date convertToDate(Object obj)
      try read a Date from a Object
      Parameters:
      obj - object to convert to date
      Returns:
      a date value