de.webdings.tools.time
Class TimeSince
java.lang.Object
de.webdings.tools.time.TimeSince
public class TimeSince
extends java.lang.Object
TimeSince is used to tell how much time has passed
between two points in time.
Version:
- Copyright 2005 by Stefan Thesing
Website: http://www.webdings.de
int[] | getDaysMonthsYearsSince(GregorianCalendar start) - Returns the timespan between
1.
|
int[] | getDaysMonthsYearsSince(GregorianCalendar start, GregorianCalendar stop) - Returns the timespan between two specified
points in time as an array containing
Index | Information |
0 | full years |
1 | full months |
2 | full days |
|
String | getDaysMonthsYearsSinceAsString(GregorianCalendar start) - Returns the timespan between
1.
|
String | getDaysMonthsYearsSinceAsString(GregorianCalendar start, GregorianCalendar stop) - Returns the timespan between two specified
points in time as a String in the following form:
42 years, 5 months, 23 days
|
int | getDaysSince(GregorianCalendar start) - Returns the timespan between
1.
|
int | getDaysSince(GregorianCalendar start, GregorianCalendar stop) - Returns the timespan between two specified
points in time in full days
|
long | getHoursSince(GregorianCalendar start) - Returns the timespan between
1.
|
long | getHoursSince(GregorianCalendar start, GregorianCalendar stop) - Returns the timespan between two specified
points in time in full hours
|
long | getMilliSecondsSince(GregorianCalendar start) - Returns the timespan between
1.
|
long | getMilliSecondsSince(GregorianCalendar start, GregorianCalendar stop) - Returns the timespan between two points in time
in full milliseconds.
|
long | getMinutesSince(GregorianCalendar start) - Returns the timespan between
1.
|
long | getMinutesSince(GregorianCalendar start, GregorianCalendar stop) - Returns the timespan between two specified
points in time in full minutes
|
int | getMonthsSince(GregorianCalendar start) - Returns the timespan between
1.
|
int | getMonthsSince(GregorianCalendar start, GregorianCalendar stop) - Returns the timespan between two specified
points in time in full months
|
long | getSecondsSince(GregorianCalendar start) - Returns the timespan between
1.
|
long | getSecondsSince(GregorianCalendar start, GregorianCalendar stop) - Returns the timespan between two specified
points in time in full seconds.
|
int | getWeeksSince(GregorianCalendar start) - Returns the timespan between
1.
|
int | getWeeksSince(GregorianCalendar start, GregorianCalendar stop) - Returns the timespan between two specified
points in time in full weeks
|
int | getYearsSince(GregorianCalendar start) - Returns the timespan between
1.
|
int | getYearsSince(GregorianCalendar start, GregorianCalendar stop) - Returns the timespan between two specified
points in time in full years
|
getDaysMonthsYearsSince
public int[] getDaysMonthsYearsSince(GregorianCalendar start)
Returns the timespan between
1. a specified past point of time and
2. the moment this method is called (now)
as an array containing
Index | Information |
0 | full years |
1 | full months |
2 | full days |
start
- past point
- Time-span in full years, full months, full days as
an array containing
int
s.
getDaysMonthsYearsSince
public int[] getDaysMonthsYearsSince(GregorianCalendar start,
GregorianCalendar stop)
Returns the timespan between two specified
points in time as an array containing
Index | Information |
0 | full years |
1 | full months |
2 | full days |
start
- Beginning of the measured time-span.stop
- End of the measured time-span.
- Time-span in full years, full months, full days as
an array containing
int
s.
getDaysMonthsYearsSinceAsString
public String getDaysMonthsYearsSinceAsString(GregorianCalendar start)
Returns the timespan between
1. a specified past point of time and
2. the moment this method is called (now)
as a String in the following form:
42 years, 5 months, 23 days
start
- past point
- Time-span in full years, full months
and full days as a String
getDaysMonthsYearsSinceAsString
public String getDaysMonthsYearsSinceAsString(GregorianCalendar start,
GregorianCalendar stop)
Returns the timespan between two specified
points in time as a String in the following form:
42 years, 5 months, 23 days
start
- Beginning of the measured time-span.stop
- End of the measured time-span.
- Time-span in full years, full months
and full days as a String
getDaysSince
public int getDaysSince(GregorianCalendar start)
Returns the timespan between
1. a specified past point of time and
2. the moment this method is called (now)
in full days
start
- past point
- Time-span in full days
getDaysSince
public int getDaysSince(GregorianCalendar start,
GregorianCalendar stop)
Returns the timespan between two specified
points in time in full days
start
- Beginning of the measured time-span.stop
- End of the measured time-span.
- Time-span in full days
getHoursSince
public long getHoursSince(GregorianCalendar start)
Returns the timespan between
1. a specified past point of time and
2. the moment this method is called (now)
in full hours
start
- past point
- Time-span in full hours
getHoursSince
public long getHoursSince(GregorianCalendar start,
GregorianCalendar stop)
Returns the timespan between two specified
points in time in full hours
start
- Beginning of the measured time-span.stop
- End of the measured time-span.
- Time-span in full hours
getMilliSecondsSince
public long getMilliSecondsSince(GregorianCalendar start)
Returns the timespan between
1. a specified past point of time and
2. the moment this method is called (now)
in full milliseconds
start
- past point
- Time-span in full milliseconds
getMilliSecondsSince
public long getMilliSecondsSince(GregorianCalendar start,
GregorianCalendar stop)
Returns the timespan between two points in time
in full milliseconds.
start
- Beginning of the measured time-span.stop
- End of the measured time-span.
- Time-span in full milliseconds
getMinutesSince
public long getMinutesSince(GregorianCalendar start)
Returns the timespan between
1. a specified past point of time and
2. the moment this method is called (now)
in full minutes
start
- past point
- Time-span in full minutes
getMinutesSince
public long getMinutesSince(GregorianCalendar start,
GregorianCalendar stop)
Returns the timespan between two specified
points in time in full minutes
start
- Beginning of the measured time-span.stop
- End of the measured time-span.
- Time-span in full minutes
getMonthsSince
public int getMonthsSince(GregorianCalendar start)
Returns the timespan between
1. a specified past point of time and
2. the moment this method is called (now)
in full months
start
- past point
- Time-span in full months
getMonthsSince
public int getMonthsSince(GregorianCalendar start,
GregorianCalendar stop)
Returns the timespan between two specified
points in time in full months
start
- Beginning of the measured time-span.stop
- End of the measured time-span.
- Time-span in full months
getSecondsSince
public long getSecondsSince(GregorianCalendar start)
Returns the timespan between
1. a specified past point of time and
2. the moment this method is called (now)
in full seconds
start
- past point
- Time-span in full seconds
getSecondsSince
public long getSecondsSince(GregorianCalendar start,
GregorianCalendar stop)
Returns the timespan between two specified
points in time in full seconds.
start
- Beginning of the measured time-span.stop
- End of the measured time-span.
- Time-span in full seconds
getWeeksSince
public int getWeeksSince(GregorianCalendar start)
Returns the timespan between
1. a specified past point of time and
2. the moment this method is called (now)
in full weeks
start
- past point
- Time-span in full weeks
getWeeksSince
public int getWeeksSince(GregorianCalendar start,
GregorianCalendar stop)
Returns the timespan between two specified
points in time in full weeks
start
- Beginning of the measured time-span.stop
- End of the measured time-span.
- Time-span in full weeks
getYearsSince
public int getYearsSince(GregorianCalendar start)
Returns the timespan between
1. a specified past point of time and
2. the moment this method is called (now)
in full years
start
- past point
- Time-span in full years
getYearsSince
public int getYearsSince(GregorianCalendar start,
GregorianCalendar stop)
Returns the timespan between two specified
points in time in full years
start
- Beginning of the measured time-span.stop
- End of the measured time-span.
- Time-span in full years
Copyright 2005 by Stefan Thesing
This program is free software; you can
redistribute it and/or modify it under the terms
of the GNU General Public License as published by
the Free Software Foundation; either version 2 of
the License, or (at your option) any later version.
This program is distributed in the hope that it
will be useful, but WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
You should have received a copy of the GNU
General Public License along with this program;
if not, write to the
Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.