| java.lang.Object org.mmbase.bridge.util.xml.DateFormat
DateFormat | public class DateFormat (Code) | | 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"
>
author: Nico Klasens author: Martijn Houtman author: Michiel Meeuwissen version: $Id: DateFormat.java,v 1.15 2007/04/09 19:10:27 michiel Exp $ since: MMBase-1.7 |
Method Summary | |
public 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
Parameters: number - the number or alias of the node containing the field Parameters: fieldName - the name of the field to format Parameters: pattern - the date pattern (i.e. | public 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
Parameters: cloudName - the name of the cloud in which to find the node Parameters: number - the number or alias of the node containing the field Parameters: fieldName - the name of the field to format Parameters: pattern - the date pattern (i.e. | public static String | format(Cloud cloud, String number, String fieldName, String pattern, String timeZone) Formats a node's field value with the date pattern
Parameters: cloud - the cloud in which to find the node Parameters: number - the number or alias of the node containing the field Parameters: fieldName - the name of the field to format Parameters: pattern - the date pattern (i.e. | public static String | format(String fieldValue, String pattern, String timeZone, String language, String country) Formats the fieldvalue to a date pattern
Parameters: fieldValue - time-stamp in seconds Parameters: pattern - the date pattern (i.e. | public static String | format(String fieldValue, String pattern, int factor, String timeZone, String language, String country) Formats the fieldvalue to a date pattern
Parameters: fieldValue - time-stamp Parameters: pattern - the date pattern (i.e. | protected static String | format(String fieldValue, String pattern, int factor, String timeZone, Locale locale) Parameters: fieldValue - time-stamp Parameters: pattern - the date pattern (i.e. | public static String | format(Cloud cloud, org.w3c.dom.Node node, String fieldName, String pattern, String timeZone) Formats a node's field value with the date pattern.
This version requires you to supply a DOM node. | public static int | getDatePart(String fieldValue, int factor, int datePart) Returns the a part of the date
Parameters: fieldValue - time-stamp Parameters: factor - Factor to multiply fieldvalue to make milliseconds. | public static int | getDatePart(String fieldValue, int factor, int datePart, String timeZone) Returns the a part of the date
Parameters: fieldValue - time-stamp Parameters: factor - Factor to multiply fieldvalue to make milliseconds. | public static int | getDay(String fieldValue) | public static int | getDay(String fieldValue, String timeZone) | public static int | getHours(String fieldValue) | public static int | getHours(String fieldValue, String timeZone) | public static int | getMinutes(String fieldValue) | public static int | getMinutes(String fieldValue, String timeZone) | public static int | getMonth(String fieldValue) | public static int | getMonth(String fieldValue, String timeZone) | public static int | getSeconds(String fieldValue) | public static int | getSeconds(String fieldValue, String timeZone) | public static int | getYear(String fieldValue) | public static int | getYear(String fieldValue, String timeZone) |
format | public static String format(String number, String fieldName, String pattern, String timeZone, String language, String country)(Code) | | Formats a node's field value with the date pattern
Parameters: number - the number or alias of the node containing the field Parameters: fieldName - the name of the field to format Parameters: pattern - the date pattern (i.e. 'dd-MM-yyyy') Parameters: timeZone - timezone of the field value Parameters: language - Language of the field value Parameters: country - country of the field value the formatted string |
format | public static String format(String cloudName, String number, String fieldName, String pattern, String timeZone, String language, String country)(Code) | | Formats a node's field value with the date pattern
Parameters: cloudName - the name of the cloud in which to find the node Parameters: number - the number or alias of the node containing the field Parameters: fieldName - the name of the field to format Parameters: pattern - the date pattern (i.e. 'dd-MM-yyyy') Parameters: timeZone - timezone of the field value Parameters: language - Language of the field value Parameters: country - country of the field value the formatted string |
format | public static String format(Cloud cloud, String number, String fieldName, String pattern, String timeZone)(Code) | | Formats a node's field value with the date pattern
Parameters: cloud - the cloud in which to find the node Parameters: number - the number or alias of the node containing the field Parameters: fieldName - the name of the field to format Parameters: pattern - the date pattern (i.e. 'dd-MM-yyyy') Parameters: timeZone - timezone of the field value the formatted string |
format | public static String format(String fieldValue, String pattern, String timeZone, String language, String country)(Code) | | Formats the fieldvalue to a date pattern
Parameters: fieldValue - time-stamp in seconds Parameters: pattern - the date pattern (i.e. 'dd-MM-yyyy') Parameters: timeZone - timezone of the field value Parameters: language - Language of the field value Parameters: country - country of the field value the formatted string |
format | public static String format(String fieldValue, String pattern, int factor, String timeZone, String language, String country)(Code) | | Formats the fieldvalue to a date pattern
Parameters: fieldValue - time-stamp Parameters: pattern - the date pattern (i.e. 'dd-MM-yyyy') Parameters: factor - Factor to multiply fieldvalue to make milliseconds. Should be 1000 normally (so field in seconds) Parameters: timeZone - Timezone. Null or blank means server timezone. If not recognized it will fall back to GMT. Parameters: language - The language for which the date must be formatted. Parameters: country - The country for which the date must be formatted. the formatted string |
format | protected static String format(String fieldValue, String pattern, int factor, String timeZone, Locale locale)(Code) | | Parameters: fieldValue - time-stamp Parameters: pattern - the date pattern (i.e. 'dd-MM-yyyy') Parameters: factor - Factor to multiply fieldvalue to make milliseconds. Should be 1000 normally (so field in seconds) Parameters: timeZone - Timezone. Null or blank means server timezone. If not recognized it will fall back to GMT. Parameters: locale - The locale for which the date must be formatted. the formatted String |
format | public static String format(Cloud cloud, org.w3c.dom.Node node, String fieldName, String pattern, String timeZone) throws XPathExpressionException(Code) | | Formats a node's field value with the date pattern.
This version requires you to supply a DOM node. It will search for a tag of the form
<field name='number' > and uses it's contents to retrieve the node.
Parameters: cloud - the cloud in which to find the node Parameters: node - A DOM node (xml) containing the node's fields as subtags Parameters: fieldName - the name of the field to format Parameters: pattern - the date pattern (i.e. 'dd-MM-yyyy') Parameters: timeZone - The timezone of the field value the formatted string throws: javax.xml.transform.TransformerException - if something went wrong while searching the DOM Node |
getDatePart | public static int getDatePart(String fieldValue, int factor, int datePart)(Code) | | Returns the a part of the date
Parameters: fieldValue - time-stamp Parameters: factor - Factor to multiply fieldvalue to make milliseconds. Should be 1000 normally (so field in seconds) Parameters: datePart - which part of the date should be returned. These are Calendar constants a part |
getDatePart | public static int getDatePart(String fieldValue, int factor, int datePart, String timeZone)(Code) | | Returns the a part of the date
Parameters: fieldValue - time-stamp Parameters: factor - Factor to multiply fieldvalue to make milliseconds. Should be 1000 normally (so field in seconds) Parameters: datePart - which part of the date should be returned. These are Calendar constants Parameters: timeZone - Timezone. Null or blank means server timezone. If not recognized it will fall back to GMT. a part |
getDay | public static int getDay(String fieldValue)(Code) | | Returns the day of the month part of the date
Parameters: fieldValue - time-stamp day of the month part |
getDay | public static int getDay(String fieldValue, String timeZone)(Code) | | Returns the day of the month part of the date
Parameters: fieldValue - time-stamp Parameters: timeZone - timezone day of the month part |
getHours | public static int getHours(String fieldValue)(Code) | | Returns the hours part of the date
Parameters: fieldValue - time-stamp hours part |
getHours | public static int getHours(String fieldValue, String timeZone)(Code) | | Returns the hours part of the date
Parameters: fieldValue - time-stamp Parameters: timeZone - timezone hours part |
getMinutes | public static int getMinutes(String fieldValue)(Code) | | Returns the minutes part of the date
Parameters: fieldValue - time-stamp minutes part |
getMinutes | public static int getMinutes(String fieldValue, String timeZone)(Code) | | Returns the minutes part of the date
Parameters: fieldValue - time-stamp Parameters: timeZone - timezone minutes part |
getMonth | public static int getMonth(String fieldValue)(Code) | | Returns the month part of the date
Parameters: fieldValue - time-stamp month part |
getMonth | public static int getMonth(String fieldValue, String timeZone)(Code) | | Returns the month part of the date
Parameters: fieldValue - time-stamp Parameters: timeZone - timezone month part |
getSeconds | public static int getSeconds(String fieldValue)(Code) | | Returns the seconds part of the date
Parameters: fieldValue - time-stamp seconds part |
getSeconds | public static int getSeconds(String fieldValue, String timeZone)(Code) | | Returns the seconds part of the date
Parameters: fieldValue - time-stamp Parameters: timeZone - timezone seconds part |
getYear | public static int getYear(String fieldValue)(Code) | | Returns the year part of the date
Parameters: fieldValue - time-stamp year part |
getYear | public static int getYear(String fieldValue, String timeZone)(Code) | | Returns the year part of the date
Parameters: fieldValue - time-stamp Parameters: timeZone - timezone year part |
|
|