Package org.matomo.java.tracking
Class MatomoDate
- java.lang.Object
-
- org.matomo.java.tracking.MatomoDate
-
-
Constructor Summary
Constructors Constructor Description MatomoDate()Allocates a Date object and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.MatomoDate(long epochMilli)Allocates a Date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetTime()Converts this datetime to the number of milliseconds from the epoch of 1970-01-01T00:00:00Z.voidsetTimeZone(ZoneId zone)Sets the time zone of the String that will be returned bytoString().StringtoString()Converts this MatomoDate object to a String of the form:
yyyy-MM-dd hh:mm:ss.
-
-
-
Constructor Detail
-
MatomoDate
public MatomoDate()
Allocates a Date object and initializes it so that it represents the time at which it was allocated, measured to the nearest millisecond.
-
MatomoDate
public MatomoDate(long epochMilli)
Allocates a Date object and initializes it to represent the specified number of milliseconds since the standard base time known as "the epoch", namely January 1, 1970, 00:00:00 GMT.- Parameters:
epochMilli- the milliseconds since January 1, 1970, 00:00:00 GMT.
-
-
Method Detail
-
setTimeZone
public void setTimeZone(ZoneId zone)
Sets the time zone of the String that will be returned bytoString(). Defaults to UTC.- Parameters:
zone- the TimeZone to set
-
toString
public String toString()
Converts this MatomoDate object to a String of the form:
yyyy-MM-dd hh:mm:ss.
-
getTime
public long getTime()
Converts this datetime to the number of milliseconds from the epoch of 1970-01-01T00:00:00Z.- Returns:
- the number of milliseconds since the epoch of 1970-01-01T00:00:00Z
- Throws:
ArithmeticException- if numeric overflow occurs
-
-