public class DateFormat extends Object
<xsl:stylesheet version = "1.0"
xmlns:xsl ="http://www.w3.org/1999/XSL/Transform"
xmlns:date ="org.mmbase.bridge.util.xml.DateFormat"
>
| Constructor and Description |
|---|
DateFormat() |
| Modifier and Type | Method and Description |
|---|---|
static String |
format(Cloud cloud,
Node node,
String fieldName,
String pattern,
String timeZone)
Deprecated.
not sure where this is used?
|
static String |
format(Cloud cloud,
String number,
String fieldName,
String pattern,
String timeZone)
Formats a node's field value with the date pattern
|
protected static String |
format(String fieldValue,
String pattern,
int factor,
String timeZone,
Locale locale) |
static String |
format(String fieldValue,
String pattern,
int factor,
String timeZone,
String language,
String country)
Formats the fieldvalue to a date pattern
|
static String |
format(String fieldValue,
String pattern,
String timeZone,
String language,
String country)
Formats the fieldvalue to a date pattern
|
static String |
format(String number,
String fieldName,
String pattern,
String timeZone,
String language,
String country)
Formats a node's field value with the date pattern
|
static String |
format(String cloudName,
String number,
String fieldName,
String pattern,
String timeZone,
String language,
String country)
Formats a node's field value with the date pattern
|
static int |
getDatePart(String fieldValue,
int factor,
int datePart)
Returns the a part of the date
|
static int |
getDatePart(String fieldValue,
int factor,
int datePart,
String timeZone)
Returns the a part of the date
|
static int |
getDay(String fieldValue)
Returns the day of the month part of the date
|
static int |
getDay(String fieldValue,
String timeZone)
Returns the day of the month part of the date
|
static int |
getHours(String fieldValue)
Returns the hours part of the date
|
static int |
getHours(String fieldValue,
String timeZone)
Returns the hours part of the date
|
static int |
getMinutes(String fieldValue)
Returns the minutes part of the date
|
static int |
getMinutes(String fieldValue,
String timeZone)
Returns the minutes part of the date
|
static int |
getMonth(String fieldValue)
Returns the month part of the date
|
static int |
getMonth(String fieldValue,
String timeZone)
Returns the month part of the date
|
static int |
getSeconds(String fieldValue)
Returns the seconds part of the date
|
static int |
getSeconds(String fieldValue,
String timeZone)
Returns the seconds part of the date
|
static int |
getYear(String fieldValue)
Returns the year part of the date
|
static int |
getYear(String fieldValue,
String timeZone)
Returns the year part of the date
|
public static String format(String number, String fieldName, String pattern, String timeZone, String language, String country)
number - the number or alias of the node containing the fieldfieldName - the name of the field to formatpattern - the date pattern (i.e. 'dd-MM-yyyy')timeZone - timezone of the field valuelanguage - Language of the field valuecountry - country of the field valuepublic static String format(String cloudName, String number, String fieldName, String pattern, String timeZone, String language, String country)
cloudName - the name of the cloud in which to find the nodenumber - the number or alias of the node containing the fieldfieldName - the name of the field to formatpattern - the date pattern (i.e. 'dd-MM-yyyy')timeZone - timezone of the field valuelanguage - Language of the field valuecountry - country of the field valuepublic static String format(Cloud cloud, String number, String fieldName, String pattern, String timeZone)
cloud - the cloud in which to find the nodenumber - the number or alias of the node containing the fieldfieldName - the name of the field to formatpattern - the date pattern (i.e. 'dd-MM-yyyy')timeZone - timezone of the field valuepublic static String format(String fieldValue, String pattern, String timeZone, String language, String country)
fieldValue - time-stamp in secondspattern - the date pattern (i.e. 'dd-MM-yyyy')timeZone - timezone of the field valuelanguage - Language of the field valuecountry - country of the field valuepublic static String format(String fieldValue, String pattern, int factor, String timeZone, String language, String country)
fieldValue - time-stamppattern - the date pattern (i.e. 'dd-MM-yyyy')factor - Factor to multiply fieldvalue to make milliseconds. Should be 1000 normally (so field in seconds)timeZone - Timezone. Null or blank means server timezone. If not recognized it will fall back to GMT.language - The language for which the date must be formatted.country - The country for which the date must be formatted.protected static String format(String fieldValue, String pattern, int factor, String timeZone, Locale locale)
fieldValue - time-stamppattern - the date pattern (i.e. 'dd-MM-yyyy')factor - Factor to multiply fieldvalue to make milliseconds. Should be 1000 normally (so field in seconds)timeZone - Timezone. Null or blank means server timezone. If not recognized it will fall back to GMT.locale - The locale for which the date must be formatted.public static String format(Cloud cloud, Node node, String fieldName, String pattern, String timeZone) throws XPathExpressionException
cloud - the cloud in which to find the nodenode - A DOM node (xml) containing the node's fields as subtagsfieldName - the name of the field to formatpattern - the date pattern (i.e. 'dd-MM-yyyy')timeZone - The timezone of the field valueTransformerException - if something went wrong while searching the DOM NodeXPathExpressionExceptionpublic static int getYear(String fieldValue)
fieldValue - time-stamppublic static int getMonth(String fieldValue)
fieldValue - time-stamppublic static int getDay(String fieldValue)
fieldValue - time-stamppublic static int getHours(String fieldValue)
fieldValue - time-stamppublic static int getMinutes(String fieldValue)
fieldValue - time-stamppublic static int getSeconds(String fieldValue)
fieldValue - time-stamppublic static int getYear(String fieldValue, String timeZone)
fieldValue - time-stamptimeZone - timezonepublic static int getMonth(String fieldValue, String timeZone)
fieldValue - time-stamptimeZone - timezonepublic static int getDay(String fieldValue, String timeZone)
fieldValue - time-stamptimeZone - timezonepublic static int getHours(String fieldValue, String timeZone)
fieldValue - time-stamptimeZone - timezonepublic static int getMinutes(String fieldValue, String timeZone)
fieldValue - time-stamptimeZone - timezonepublic static int getSeconds(String fieldValue, String timeZone)
fieldValue - time-stamptimeZone - timezonepublic static int getDatePart(String fieldValue, int factor, int datePart)
fieldValue - time-stampfactor - Factor to multiply fieldvalue to make milliseconds. Should be 1000 normally (so field in seconds)datePart - which part of the date should be returned. These are Calendar constantspublic static int getDatePart(String fieldValue, int factor, int datePart, String timeZone)
fieldValue - time-stampfactor - Factor to multiply fieldvalue to make milliseconds. Should be 1000 normally (so field in seconds)datePart - which part of the date should be returned. These are Calendar constantstimeZone - Timezone. Null or blank means server timezone. If not recognized it will fall back to GMT.MMBase 1.9-SNAPSHOT - ${javadoctimestamp}