public class DateLeolaLibrary extends Object implements LeolaLibrary
Constructor and Description |
---|
DateLeolaLibrary() |
Modifier and Type | Method and Description |
---|---|
Date |
addDays(Date date,
int days)
Add/subtract the number of days to the supplied date
|
Date |
addEra(Date date,
int era)
Add/subtract the era to the supplied date
|
Date |
addHours(Date date,
int hours)
Add/subtract the number of hours to the supplied date
|
Date |
addMinutes(Date date,
int minutes)
Add/subtract the number of minutes to the supplied date
|
Date |
addMonths(Date date,
int months)
Add/subtract the number of months to the supplied date
|
Date |
addMSecs(Date date,
int msec)
Add/subtract the number of milli-seconds to the supplied date
|
Date |
addSeconds(Date date,
int seconds)
Add/subtract the number of seconds to the supplied date
|
Date |
addYears(Date date,
int years)
Add/subtract the number of Years to the supplied date
|
String |
format(Date date,
String format)
Formats the supplied
Date |
int |
getDay(Date date) |
int |
getEra(Date date) |
int |
getHour(Date date) |
int |
getMinute(Date date) |
int |
getMonth(Date date) |
int |
getMSec(Date date) |
int |
getSecond(Date date) |
String |
getTimeZone() |
int |
getYear(Date date) |
void |
init(Leola runtime,
LeoNamespace namespace)
Initializes the library.
|
Date |
newDate(String date,
String format)
Creates a new Date based off of the supplied string date, in the specified format
|
Date |
now() |
void |
setTimeZone(String timeZone)
Sets the default time zone
|
long |
time() |
long |
timens() |
Date |
toDate(long time) |
long |
toMSec(Date date)
Returns the number of milliseconds since January 1, 1970, 00:00:00 GMT represented by this Date object.
|
Timestamp |
toTimestamp(Date date)
|
public void init(Leola runtime, LeoNamespace namespace) throws LeolaRuntimeException
LeolaLibrary
init
in interface LeolaLibrary
LeolaRuntimeException
public Date newDate(String date, String format) throws Exception
date
- format
- Exception
public String format(Date date, String format)
Date
date
- format
- public void setTimeZone(String timeZone)
timeZone
- public String getTimeZone()
public int getMSec(Date date)
date
- public int getSecond(Date date)
date
- public int getMinute(Date date)
date
- public int getHour(Date date)
date
- public int getDay(Date date)
date
- public int getMonth(Date date)
date
- public int getYear(Date date)
date
- public int getEra(Date date)
date
- public long toMSec(Date date)
date
- public long time()
public long timens()
public Date addMSecs(Date date, int msec)
date
- msec
- Date
public Date addSeconds(Date date, int seconds)
date
- seconds
- Date
public Date addMinutes(Date date, int minutes)
date
- minutes
- Date
public Date addHours(Date date, int hours)
date
- hours
- Date
public Date addDays(Date date, int days)
date
- days
- Date
public Date addMonths(Date date, int months)
date
- months
- Date
public Date addYears(Date date, int years)
date
- years
- Date
Copyright © 2010–2015. All rights reserved.