Class DateTimeUtil

java.lang.Object
ch.tocco.nice2.types.api.DateTimeUtil

public class DateTimeUtil extends Object
  • Field Details

  • Method Details

    • createLocalDateFromConstant

      public static org.joda.time.LocalDate createLocalDateFromConstant(String word, org.joda.time.DateTimeZone dateTimeZone)
      Creates a LocalDate object that corresponds to the specified word, which may be 'today', 'tomorrow' or 'yesterday' as defined by those constants in this class.
      Parameters:
      word - the special keyword for a date constant
      Returns:
      a org.joda.time.LocalDate object, or null if the word is unknown
    • createDateTimeFromConstant

      public static org.joda.time.DateTime createDateTimeFromConstant(String word, org.joda.time.DateTimeZone dateTimeZone)
      Creates a DateTime object that corresponds to the specified word, which may be 'today', 'tomorrow' or 'yesterday' as defined by those constants in this class. The identifier 'start' may be added (prefixed by a '_') to any of the above words to get a timestamp at the beginning (i.e. midnight) of the requested date in the provided timezone.
      Parameters:
      word - the special keyword for a date constant
      dateTimeZone - time zone to interpret the provided word in
      Returns:
      a org.joda.time.DateTime object, or null if the word is unknown