You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stefan Shoeman <st...@googlemail.com> on 2007/03/21 12:52:46 UTC

conversion of a Unix timestamp to a ISO date

Hello *,

how can I convert a Unix timestamp (for example 1174475521) into a
regular ISO-format?

I tried it with xsl (xs:date-time), but then I get a error, that the
java-date class
isn't available for Coocon.

...any better solutions?

--
Regards,

Stefan Shoeman

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: conversion of a Unix timestamp to a ISO date

Posted by Stefan Shoeman <st...@googlemail.com>.
Thanks Bertrand, Andrew, Lars and Thomas for all your hints...

Stefan

2007/3/22, Thomas Soddemann <so...@rzg.mpg.de>:
> Hi,
>
> you could also simply use Axis's xs library, Axiom or xmlbeans.
>
> Cheers,
> Thomas
>
> Lars Trieloff wrote:
> > Hi,
> >
> > there is an XSLT library available for this:
> > http://www.djkaty.com/drupal/xsl-date-time
> >
> > with best regards,
> >
> > Lars
> >
> > Am 21.03.2007 um 12:52 schrieb Stefan Shoeman:
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: conversion of a Unix timestamp to a ISO date

Posted by Thomas Soddemann <so...@rzg.mpg.de>.
Hi,

you could also simply use Axis's xs library, Axiom or xmlbeans.

Cheers,
Thomas

Lars Trieloff wrote:
> Hi,
>
> there is an XSLT library available for this: 
> http://www.djkaty.com/drupal/xsl-date-time
>
> with best regards,
>
> Lars
>
> Am 21.03.2007 um 12:52 schrieb Stefan Shoeman:
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: conversion of a Unix timestamp to a ISO date

Posted by Lars Trieloff <la...@trieloff.net>.
Hi,

there is an XSLT library available for this: http://www.djkaty.com/ 
drupal/xsl-date-time

with best regards,

Lars

Am 21.03.2007 um 12:52 schrieb Stefan Shoeman:

> Hello *,
>
> how can I convert a Unix timestamp (for example 1174475521) into a
> regular ISO-format?
>
> I tried it with xsl (xs:date-time), but then I get a error, that the
> java-date class
> isn't available for Coocon.
>
> ...any better solutions?
>
> --
> Regards,
>
> Stefan Shoeman
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>

--
Lars Trieloff
visit http://www.mindquarry.com/




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: conversion of a Unix timestamp to a ISO date

Posted by Andrew Stevens <at...@hotmail.com>.
>From: "Bertrand Delacretaz" <bd...@apache.org>
>Date: Wed, 21 Mar 2007 13:30:14 +0100
>
>On 3/21/07, Stefan Shoeman <st...@googlemail.com> wrote:
>
>>...I tried it with xsl (xs:date-time), but then I get a error, that the
>>java-date class isn't available for Coocon...
>
>You could use a the SimpleDateFormat as a java extension, example:
>
><xsl:transform
>    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>    version="1.0"
>    xmlns:dateFormat="java:java.text.SimpleDateFormat"
>    >

I may be wrong, but don't you also have to define a 'java" namespace prefix 
for this to work? The example at 
http://xml.apache.org/xalan-j/extensions.html#ex-java-namespace uses
xmlns:java="http://xml.apache.org/xalan/java"


Andrew.
--
http://pseudoq.sourceforge.net/  Open source java Sudoku designer & solver

_________________________________________________________________
Solve the Conspiracy and win fantastic prizes.  
http://www.theconspiracygame.co.uk/


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: conversion of a Unix timestamp to a ISO date

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 3/21/07, Stefan Shoeman <st...@googlemail.com> wrote:

> ...I tried it with xsl (xs:date-time), but then I get a error, that the
> java-date class isn't available for Coocon...

You could use a the SimpleDateFormat as a java extension, example:

<xsl:transform
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    version="1.0"
    xmlns:dateFormat="java:java.text.SimpleDateFormat"
    >
    <xsl:variable name="outputDateFormat" select="'yyyyMMddHHmm'"/>
...
  <xsl:variable name="formatter" select="dateFormat:new($outputDateFormat)"/>
  <xsl:value-of select="dateFormat:format($formatter,$yourDateValue)"/>

HTH,
-Bertrand

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org