Class DateTimeFunctions
java.lang.Object
net.sf.jasperreports.functions.AbstractFunctionSupport
net.sf.jasperreports.functions.standard.DateTimeFunctions
- All Implemented Interfaces:
FunctionSupport
This class should maintain all function methods that belongs to the DateTime category.
- Author:
- Massimo Rabbi (mrabbi@users.sourceforge.net)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionCreates a date object using the specified information on day, month and year.DATEFORMAT
(Date dateObj, String formatPattern) Format the specified date object using the chosen format pattern.Allows to create a JasperReports DateRange instance starting from either a String expression or a Date instance.Gives the corresponding numeric value (long milliseconds) for a specified date object.Returns the day of a given date.Returns the number of days between two dates.DAYSINMONTH
(Object dateObj) Returns the number of days in a month.DAYSINYEAR
(Object dateObj) Returns the number of days in a year.Returns a date a number of months away.Returns the hour (0-23) of the day for a given date.ISLEAPYEAR
(Object dateObj) Checks if the given date occurs in a leap year.Returns the minute (0-59) of the hour for a given date.Returns the month of a given date.Returns the number of months between two dates.NETWORKDAYS
(Object startDate, Object endDate) Returns the number of working days between two dates (inclusive).NOW()
Returns the current instant as date object.Returns the second (0-59) of the minute for a given date.Returns a text string representing a time value (hours, seconds and minutes).TODAY()
Returns the current date as date object.Returns the day of the week for a given date.Returns the week number of a given date.Returns the number of weeks between two dates.WEEKSINYEAR
(Object dateObj) Returns the number of weeks in a year.Returns a date a number of workdays away.Returns the year of a given date.Returns the number of years between two dates.Methods inherited from class net.sf.jasperreports.functions.AbstractFunctionSupport
getContext, init
-
Constructor Details
-
DateTimeFunctions
public DateTimeFunctions()
-
-
Method Details
-
TODAY
Returns the current date as date object. -
NOW
Returns the current instant as date object. -
YEAR
Returns the year of a given date. Date object can be a String, long value (milliseconds) or Date instance itself. -
MONTH
Returns the month of a given date. Date object can be a String, long value (milliseconds) or Date instance itself. -
DAY
Returns the day of a given date. Date object can be a String, long value (milliseconds) or Date instance itself. -
WEEKDAY
Returns the day of the week for a given date. Date object can be a String, long value (milliseconds) or Date instance itself. -
WEEKDAY
-
HOUR
Returns the hour (0-23) of the day for a given date. Date object can be a String, long value (milliseconds) or Date instance itself. -
MINUTE
Returns the minute (0-59) of the hour for a given date. Date object can be a String, long value (milliseconds) or Date instance itself. -
SECOND
Returns the second (0-59) of the minute for a given date. Date object can be a String, long value (milliseconds) or Date instance itself. -
DATE
Creates a date object using the specified information on day, month and year. -
DATEVALUE
Gives the corresponding numeric value (long milliseconds) for a specified date object. -
TIME
Returns a text string representing a time value (hours, seconds and minutes). If no specific pattern is specified a default formatter is used. -
TIME
-
EDATE
Returns a date a number of months away. -
WORKDAY
Returns a date a number of workdays away. Saturday and Sundays are not considered working days. -
NETWORKDAYS
Returns the number of working days between two dates (inclusive). Saturday and Sunday are not considered working days. -
DAYS
Returns the number of days between two dates. -
DAYSINMONTH
Returns the number of days in a month. -
DAYSINYEAR
Returns the number of days in a year. -
WEEKS
Returns the number of weeks between two dates. -
WEEKSINYEAR
Returns the number of weeks in a year. -
WEEKNUM
Returns the week number of a given date. -
MONTHS
Returns the number of months between two dates. -
YEARS
Returns the number of years between two dates. -
ISLEAPYEAR
Checks if the given date occurs in a leap year. -
DATEFORMAT
Format the specified date object using the chosen format pattern. -
DATERANGE
Allows to create a JasperReports DateRange instance starting from either a String expression or a Date instance.
-