Class JodaTimePlugin

    • Constructor Detail

      • JodaTimePlugin

        public JodaTimePlugin​(String name,
                              String className,
                              XWikiContext context)
        Parameters:
        name - the plugin name, usually ignored, since plugins have a fixed name
        className - the name of this class, ignored
        context - the current request context
    • Method Detail

      • getDateTime

        public org.joda.time.DateTime getDateTime()
        See Also:
        DateTime()
      • getDateTime

        public org.joda.time.DateTime getDateTime​(int year,
                                                  int monthOfYear,
                                                  int dayOfMonth,
                                                  int hourOfDay,
                                                  int minuteOfHour,
                                                  int secondOfMinute,
                                                  int millisOfSecond)
        See Also:
        DateTime(int, int, int, int, int, int, int)
      • getDateTime

        public org.joda.time.DateTime getDateTime​(long instant)
        See Also:
        DateTime(long)
      • getMutableDateTime

        public org.joda.time.MutableDateTime getMutableDateTime()
        See Also:
        MutableDateTime()
      • getMutableDateTime

        public org.joda.time.MutableDateTime getMutableDateTime​(int year,
                                                                int monthOfYear,
                                                                int dayOfMonth,
                                                                int hourOfDay,
                                                                int minuteOfHour,
                                                                int secondOfMinute,
                                                                int millisOfSecond)
        See Also:
        MutableDateTime(int, int, int, int, int, int, int)
      • getMutableDateTime

        public org.joda.time.MutableDateTime getMutableDateTime​(long instant)
        See Also:
        MutableDateTime(long)
      • getDateTimeFormatterForPattern

        public org.joda.time.format.DateTimeFormatter getDateTimeFormatterForPattern​(String pattern,
                                                                                     XWikiContext context)
        See Also:
        DateTimeFormat.forPattern(String)
      • getDateTimeFormatterForStyle

        public org.joda.time.format.DateTimeFormatter getDateTimeFormatterForStyle​(String style,
                                                                                   XWikiContext context)
        See Also:
        DateTimeFormat.forStyle(String)
      • getServerTimezone

        public org.joda.time.DateTimeZone getServerTimezone()
        See Also:
        DateTimeZone.getDefault()
      • getUTCTimezone

        public org.joda.time.DateTimeZone getUTCTimezone()
        See Also:
        DateTimeZone.UTC
      • getTimezone

        public org.joda.time.DateTimeZone getTimezone​(String locationOrOffset)
        See Also:
        DateTimeZone.forID(String)
      • getTimezone

        public org.joda.time.DateTimeZone getTimezone​(int offsetHours)
        See Also:
        DateTimeZone.forOffsetHours(int)
      • getTimezone

        public org.joda.time.DateTimeZone getTimezone​(int offsetHours,
                                                      int offsetMinutes)
        See Also:
        DateTimeZone.forOffsetHoursMinutes(int, int)
      • getDuration

        public org.joda.time.Duration getDuration​(long millis)
        See Also:
        Duration(long)
      • getDuration

        public org.joda.time.Duration getDuration​(org.joda.time.ReadableInstant from,
                                                  org.joda.time.ReadableInstant to)
        See Also:
        Duration(ReadableInstant, ReadableInstant)
      • getISODateTimeFormatter

        public org.joda.time.format.DateTimeFormatter getISODateTimeFormatter()
        Returns:
        an ISO8601 date time formatter
        Since:
        5.2RC1