Package ghidra.util

Class DateUtils


  • public class DateUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      DateUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String formatDate​(java.util.Date date)  
      static java.lang.String formatDuration​(long millis)
      Formats a millisecond duration as a English string expressing the number of hours, minutes and seconds in the duration.
      static java.util.Date getDate​(int year, int month, int day)  
      static int getDaysBetween​(java.util.Date date1, java.util.Date date2)  
      static java.util.List<java.util.Date> getHolidays​(int year)  
      static java.util.Date getNormalizedToday()  
      static java.lang.String getTimeNow()
      Returns the current local timezone time-of-day as an HOUR:MIN string.
      static boolean isHoliday​(java.util.Calendar cal)  
      static boolean isHoliday​(java.util.Date date)  
      static boolean isWeekend​(java.util.Calendar cal)  
      static java.util.Date normalizeDate​(java.util.Date date)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DateUtils

        public DateUtils()
    • Method Detail

      • getHolidays

        public static java.util.List<java.util.Date> getHolidays​(int year)
      • isHoliday

        public static boolean isHoliday​(java.util.Date date)
      • getNormalizedToday

        public static java.util.Date getNormalizedToday()
      • normalizeDate

        public static java.util.Date normalizeDate​(java.util.Date date)
      • isHoliday

        public static boolean isHoliday​(java.util.Calendar cal)
      • isWeekend

        public static boolean isWeekend​(java.util.Calendar cal)
      • formatDate

        public static java.lang.String formatDate​(java.util.Date date)
      • getTimeNow

        public static java.lang.String getTimeNow()
        Returns the current local timezone time-of-day as an HOUR:MIN string.
        Returns:
        current time-of-day as "HOUR:MIN"
      • getDate

        public static java.util.Date getDate​(int year,
                                             int month,
                                             int day)
      • getDaysBetween

        public static int getDaysBetween​(java.util.Date date1,
                                         java.util.Date date2)
      • formatDuration

        public static java.lang.String formatDuration​(long millis)
        Formats a millisecond duration as a English string expressing the number of hours, minutes and seconds in the duration.

        Parameters:
        millis - Count of milliseconds of an elapsed duration.
        Returns:
        String such as "5 hours, 3 mins, 22 secs".