public class Duration extends Object
| Constructor and Description |
|---|
Duration(long duration)
Creates a new duration with the specified length.
|
| Modifier and Type | Method and Description |
|---|---|
int |
getDays()
Returns the number of days in the last week of this duration
|
long |
getDuration()
Returns the length of this duration.
|
int |
getHours()
Returns the number of hours in the last day of this duration.
|
int |
getMilliseconds()
Returns the number of milliseconds in the last second of this duration.
|
int |
getMinutes()
Returns the number of minutes in the last hour of this duration.
|
int |
getSeconds()
Returns the number of seconds in the last minute of this duration.
|
long |
getWeeks()
Returns the number of whole weeks in this duration.
|
String |
toString() |
String |
toString(boolean showMilliseconds)
Returns a textual representation of this duration.
|
public Duration(long duration)
duration - The length of this duration in millisecondspublic int getDays()
public long getDuration()
public int getHours()
public int getMilliseconds()
public int getMinutes()
public int getSeconds()
public long getWeeks()
public String toString()
toString in class ObjectObject.toString()public String toString(boolean showMilliseconds)
showMilliseconds - true if the milliseconds should be shown,
false otherwiseCopyright © 2026. All rights reserved.