|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.bridge.util.xml.DateFormat
Dates are stored as integer in mmbase. If you want to show these dates in a nice format in the XSL transformation. it is necessary to use this Xalan extension. The XSLT looks like this then:
<xsl:stylesheet version = "1.0"
xmlns:xsl ="http://www.w3.org/1999/XSL/Transform"
xmlns:date ="org.mmbase.bridge.util.xml.DateFormat"
>
| Constructor Summary | |
DateFormat()
|
|
| Method Summary | |
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 |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public DateFormat()
| Method Detail |
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 value
public 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 value
public 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 value
public 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 value
public 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 TransformerException
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 value
TransformerException - if something went wrong while searching the DOM Nodepublic static int getYear(String fieldValue)
fieldValue - time-stamp
public static int getMonth(String fieldValue)
fieldValue - time-stamp
public static int getDay(String fieldValue)
fieldValue - time-stamp
public static int getHours(String fieldValue)
fieldValue - time-stamp
public static int getMinutes(String fieldValue)
fieldValue - time-stamp
public static int getSeconds(String fieldValue)
fieldValue - time-stamp
public static int getYear(String fieldValue,
String timeZone)
fieldValue - time-stamptimeZone - timezone
public static int getMonth(String fieldValue,
String timeZone)
fieldValue - time-stamptimeZone - timezone
public static int getDay(String fieldValue,
String timeZone)
fieldValue - time-stamptimeZone - timezone
public static int getHours(String fieldValue,
String timeZone)
fieldValue - time-stamptimeZone - timezone
public static int getMinutes(String fieldValue,
String timeZone)
fieldValue - time-stamptimeZone - timezone
public static int getSeconds(String fieldValue,
String timeZone)
fieldValue - time-stamptimeZone - timezone
public 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 constants
public 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.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||