Package toxi.util

Class DateUtils

java.lang.Object
toxi.util.DateUtils

public class DateUtils extends Object
A Simple timestamp generator/formatter with timezone support.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final SimpleDateFormat
     
    static final TimeZone
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static final String
    Creates a formatted timestamp string of the current datetime using the local host timezone.
    static final String
    timeStamp(long t)
    Creates a formatted timestamp string of the given epoch using the local host timezone.
    static final String
    Creates a formatted timestamp string of the given date using the local host timezone.
    static final String
    timeStamp(Date date, TimeZone zone)
    Creates a formatted timestamp string of the given date using the specified timezone.
    static final String
    timeStampForZone(String zoneID, Date date)
    Creates a formatted timestamp string of the given date using the given timezone ID.
    static final String
    Creates a formatted timestamp string of the current date in GMT.
    static final String
    timeStampGMT(long t)
    Creates a formatted timestamp string of the given epoch in GMT.
    static final String
    Creates a formatted timestamp string of the given date in GMT.

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • DateUtils

      public DateUtils()
  • Method Details

    • timeStamp

      public static final String timeStamp()
      Creates a formatted timestamp string of the current datetime using the local host timezone.
      Returns:
      timestamp
    • timeStamp

      public static final String timeStamp(Date date)
      Creates a formatted timestamp string of the given date using the local host timezone.
      Parameters:
      date -
      Returns:
      timestamp
    • timeStamp

      public static final String timeStamp(Date date, TimeZone zone)
      Creates a formatted timestamp string of the given date using the specified timezone.
      Parameters:
      date -
      zone -
      Returns:
      timestamp
    • timeStamp

      public static final String timeStamp(long t)
      Creates a formatted timestamp string of the given epoch using the local host timezone.
      Parameters:
      t - unix epoch timestamp
      Returns:
      timestamp
    • timeStampForZone

      public static final String timeStampForZone(String zoneID, Date date)
      Creates a formatted timestamp string of the given date using the given timezone ID.
      Parameters:
      zoneID -
      date -
      Returns:
      timestamp
      See Also:
    • timeStampGMT

      public static final String timeStampGMT()
      Creates a formatted timestamp string of the current date in GMT.
      Returns:
      timestamp
    • timeStampGMT

      public static final String timeStampGMT(Date date)
      Creates a formatted timestamp string of the given date in GMT.
      Returns:
      timestamp
    • timeStampGMT

      public static final String timeStampGMT(long t)
      Creates a formatted timestamp string of the given epoch in GMT.
      Returns:
      timestamp