java.lang.Object
com.inductiveautomation.ignition.common.script.builtin.DateUtilities

public class DateUtilities extends Object
Date and time functions for use in scripting, to make dealing with java.util.Date objects less painful from python.
  • Constructor Details

    • DateUtilities

      public DateUtilities()
  • Method Details

    • now

      public static Date now()
    • fromMillis

      public static Date fromMillis(long millis)
    • toMillis

      public static long toMillis(Date date)
    • getTimezoneOffset

      public static double getTimezoneOffset()
    • getTimezoneOffset

      public static double getTimezoneOffset(Date date)
    • getTimezoneRawOffset

      public static double getTimezoneRawOffset()
    • getTimezone

      public static String getTimezone()
    • isDaylightTime

      public static boolean isDaylightTime()
    • isDaylightTime

      public static boolean isDaylightTime(Date date)
    • midnight

      public static Date midnight(Date date)
    • setTime

      public static Date setTime(Date d, int hour, int minute, int second)
    • getDate

      public static Date getDate(int year, int month, int day)
    • addMillis

      public static Date addMillis(Date d, int value)
    • addSeconds

      public static Date addSeconds(Date d, int value)
    • addMinutes

      public static Date addMinutes(Date d, int value)
    • addHours

      public static Date addHours(Date d, int value)
    • addDays

      public static Date addDays(Date d, int value)
    • addWeeks

      public static Date addWeeks(Date d, int value)
    • addMonths

      public static Date addMonths(Date d, int value)
    • addYears

      public static Date addYears(Date d, int value)
    • millisBetween

      public static long millisBetween(Date a, Date b)
    • secondsBetween

      public static int secondsBetween(Date a, Date b)
    • minutesBetween

      public static int minutesBetween(Date a, Date b)
    • hoursBetween

      public static int hoursBetween(Date a, Date b)
    • daysBetween

      public static int daysBetween(Date a, Date b)
    • weeksBetween

      public static int weeksBetween(Date a, Date b)
    • monthsBetween

      public static int monthsBetween(Date a, Date b)
    • yearsBetween

      public static int yearsBetween(Date a, Date b)
    • format

      public static String format(Date date)
    • format

      public static String format(Date date, String format)
    • isBefore

      public static boolean isBefore(Date a, Date b)
    • isAfter

      public static boolean isAfter(Date a, Date b)
    • isBetween

      public static boolean isBetween(Date a, Date b, Date c)
    • getQuarter

      public static int getQuarter(Date d)
    • getYear

      public static int getYear(Date d)
    • getMonth

      public static int getMonth(Date d)
    • getDayOfMonth

      public static int getDayOfMonth(Date d)
    • getDayOfYear

      public static int getDayOfYear(Date d)
    • getDayOfWeek

      public static int getDayOfWeek(Date d)
    • getHour12

      public static int getHour12(Date d)
    • getAMorPM

      public static int getAMorPM(Date d)
    • getHour24

      public static int getHour24(Date d)
    • getMinute

      public static int getMinute(Date d)
    • getSecond

      public static int getSecond(Date d)
    • getMillis

      public static int getMillis(Date d)
    • parse

      @Nullable public static Date parse(org.python.core.PyObject[] pyArgs, String[] keywords) throws ParseException
      Throws:
      ParseException