java.lang.Object
omix.lang.DateTime
- All Implemented Interfaces:
Serializable
public final class DateTime extends Object implements Serializable
This class represents date and time in the Omix network diagrams.
- Author:
- Dr. Peter Droste, Omix Visualization
- See Also:
- Serialized Form
-
Constructor Summary
Constructors Constructor Description DateTime(int year, int month, int day, int hour, int minute, int second)
creates a date time with the given year, month (1-12), day (1-31), hour of day (0-23), minute (0-59) and second (0-59)DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond)
creates a date time with the given year, month (1-12), day (1-31), hour of day (0-23), minute (0-59), second (0-59) and millisecond (0-999)DateTime(long time)
creates a date time with the absolute date representationDateTime(Date date)
creates a date time upon a java standard date format. -
Method Summary
-
Constructor Details
-
DateTime
@ConstructorProperties({"year","month","day","hour","minute","second","millisecond"}) public DateTime(int year, int month, int day, int hour, int minute, int second, int millisecond)creates a date time with the given year, month (1-12), day (1-31), hour of day (0-23), minute (0-59), second (0-59) and millisecond (0-999)- Parameters:
year
- yearmonth
- monthday
- dayhour
- hourminute
- minutesecond
- secondmillisecond
- millisecond
-
DateTime
@ConstructorProperties({"year","month","day","hour","minute","second"}) public DateTime(int year, int month, int day, int hour, int minute, int second)creates a date time with the given year, month (1-12), day (1-31), hour of day (0-23), minute (0-59) and second (0-59)- Parameters:
year
- yearmonth
- monthday
- dayhour
- hourminute
- minutesecond
- second
-
DateTime
creates a date time with the absolute date representation- Parameters:
time
- time
-
DateTime
creates a date time upon a java standard date format.- Parameters:
date
- java date
-
-
Method Details
-
getDay
public int getDay()- Returns:
- the day of this date time
-
getMonth
public int getMonth()- Returns:
- the month of this date time
-
getYear
public int getYear()- Returns:
- the year of this date time
-
getHourOfDay
public int getHourOfDay()- Returns:
- the hour of this date time
-
getMinute
public int getMinute()- Returns:
- the minute of this date time
-
getSecond
public int getSecond()- Returns:
- the second of this date time
-
getMilliSecond
public int getMilliSecond()- Returns:
- the millisecond of this date time
-
getValue
- Returns:
- the absolute date value
-
toString
- Overrides:
toString
in classObject
- Returns:
- the date time as YY-MM-DD,hh:mm:SS:sss
- See Also:
Object.toString()
-
toString
- Parameters:
format
- a format which has to contain YYYY for year, MM for month, DD for day, hh for hour, mm for minutes, SS for seconds and sss for milliseconds.- Returns:
- a string representation of the date time according the submitted format
-