public class TimeDate extends Object
Constructor and Description |
---|
TimeDate()
Create time and date with current time.
|
TimeDate(Calendar calendar)
Create time and date with current time.
|
TimeDate(int year,
int month,
int day,
int hour,
int minute,
int second)
Create time and date.
|
TimeDate(String format,
String string)
Create time and date from string.
|
Modifier and Type | Method and Description |
---|---|
String |
format(String format)
Format date-time as string.
|
int |
getDay()
Day of the month - [1,31].
|
int |
getHour()
Hour since midnight - [0,23].
|
int |
getMinute()
Minute after the hour - [0,59].
|
int |
getMonth()
Month since January - [0,11].
|
int |
getSecond()
Second after the minute - [0,59].
|
int |
getYear()
Year since 0.
|
Calendar |
toCalendar()
Convert to calendar.
|
String |
toString()
String representation for debugging purpose.
|
String |
toStringReceiptDate()
Format as "day.mount.year" string for receipts.
|
String |
toStringReceiptTime()
Format as "hour:minute:second" string for receipts.
|
String |
toStringRegular()
Format as "day-month-year hour:minute:second" string.
|
public TimeDate()
public TimeDate(int year, int month, int day, int hour, int minute, int second)
public TimeDate(Calendar calendar)
public int getYear()
public int getMonth()
public int getDay()
public int getHour()
public int getMinute()
public int getSecond()
public Calendar toCalendar()
public String toStringRegular()
public String toStringReceiptDate()
public String toStringReceiptTime()