Camel : Date Pattern

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Camel : Date Pattern

ABouchama
Hello,

to retrieve the Date in the header of the message, i put the following code :

<setHeader headerName="Date">
        <simple>${date:now:yyyy-MM-dd'T'HH:mm:ss:SSS}</simple>
</setHeader>


This date format does not work? knowing that respects the date format pattern: yyyy-MM-dd'T'HH:mm:ss.SSSZ

any idea?

Thank you in advance
Reply | Threaded
Open this post in threaded view
|

Re: Camel : Date Pattern

Claus Ibsen-2
Hi

The issue is that your pattern is complex and it contains additional : chars.
I will get that fixed in the next release.


On Tue, Jan 12, 2010 at 6:26 PM, titexe <[hidden email]> wrote:

>
> to retrieve the Date in the header of the message, i put the following code :
>
> <setHeader headerName="Date">
>        <simple>${date:now:yyyy-MM-dd'T'HH:mm:ss:SSS}</simple>
> </setHeader>
>
>
> This date format does not work? knowing that respects the date format
> pattern: yyyy-MM-dd'T'HH:mm:ss.SSSZ
>
> any idea?
>
> Thank you in advance
> --
> View this message in context: http://old.nabble.com/Camel-%3A-Date-Pattern-tp27131137p27131137.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



--
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Reply | Threaded
Open this post in threaded view
|

Re: Camel : Date Pattern

Claus Ibsen-2
Hi

Check ticket
https://issues.apache.org/activemq/browse/CAMEL-2353

On Wed, Jan 13, 2010 at 6:37 AM, Claus Ibsen <[hidden email]> wrote:

> Hi
>
> The issue is that your pattern is complex and it contains additional : chars.
> I will get that fixed in the next release.
>
>
> On Tue, Jan 12, 2010 at 6:26 PM, titexe <[hidden email]> wrote:
>>
>> to retrieve the Date in the header of the message, i put the following code :
>>
>> <setHeader headerName="Date">
>>        <simple>${date:now:yyyy-MM-dd'T'HH:mm:ss:SSS}</simple>
>> </setHeader>
>>
>>
>> This date format does not work? knowing that respects the date format
>> pattern: yyyy-MM-dd'T'HH:mm:ss.SSSZ
>>
>> any idea?
>>
>> Thank you in advance
>> --
>> View this message in context: http://old.nabble.com/Camel-%3A-Date-Pattern-tp27131137p27131137.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



--
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Reply | Threaded
Open this post in threaded view
|

Re: Camel : Date Pattern

ABouchama
This date format is the XML date format:

The dateTime  XML is specified in the following form "YYYY-MM-DDThh: mm: ss"

Claus Ibsen-2 wrote
Hi

Check ticket
https://issues.apache.org/activemq/browse/CAMEL-2353

On Wed, Jan 13, 2010 at 6:37 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> Hi
>
> The issue is that your pattern is complex and it contains additional : chars.
> I will get that fixed in the next release.
>
>
> On Tue, Jan 12, 2010 at 6:26 PM, titexe <titexe@yahoo.fr> wrote:
>>
>> to retrieve the Date in the header of the message, i put the following code :
>>
>> <setHeader headerName="Date">
>>        <simple>${date:now:yyyy-MM-dd'T'HH:mm:ss:SSS}</simple>
>> </setHeader>
>>
>>
>> This date format does not work? knowing that respects the date format
>> pattern: yyyy-MM-dd'T'HH:mm:ss.SSSZ
>>
>> any idea?
>>
>> Thank you in advance
>> --
>> View this message in context: http://old.nabble.com/Camel-%3A-Date-Pattern-tp27131137p27131137.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



--
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus
Reply | Threaded
Open this post in threaded view
|

Re: Camel : Date Pattern

ABouchama
I want to add another problem to the same bug:

Camel is incapable of generating this XML date format (XML (W3C) ISO 8601):

Exemple :

2010-12-25T18 :25:01.037-08:00

However using this class exists in jar lib "commons-lang-2.4.jar" from camel, we can succeed in having this date:

org.apache.commons.lang.time.DateFormatUtils.format (new Date (), "yyyy-MM-dd'T'HH: mm: ss.SSSZZ)


Thank you also to take this problem into consideration in your next release 2.2 of camel

titexe


titexe wrote
This date format is the XML date format:

The dateTime  XML is specified in the following form "YYYY-MM-DDThh: mm: ss"

Claus Ibsen-2 wrote
Hi

Check ticket
https://issues.apache.org/activemq/browse/CAMEL-2353

On Wed, Jan 13, 2010 at 6:37 AM, Claus Ibsen <claus.ibsen@gmail.com> wrote:
> Hi
>
> The issue is that your pattern is complex and it contains additional : chars.
> I will get that fixed in the next release.
>
>
> On Tue, Jan 12, 2010 at 6:26 PM, titexe <titexe@yahoo.fr> wrote:
>>
>> to retrieve the Date in the header of the message, i put the following code :
>>
>> <setHeader headerName="Date">
>>        <simple>${date:now:yyyy-MM-dd'T'HH:mm:ss:SSS}</simple>
>> </setHeader>
>>
>>
>> This date format does not work? knowing that respects the date format
>> pattern: yyyy-MM-dd'T'HH:mm:ss.SSSZ
>>
>> any idea?
>>
>> Thank you in advance
>> --
>> View this message in context: http://old.nabble.com/Camel-%3A-Date-Pattern-tp27131137p27131137.html
>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>
>
>
> --
> Claus Ibsen
> Apache Camel Committer
>
> Author of Camel in Action: http://www.manning.com/ibsen/
> Open Source Integration: http://fusesource.com
> Blog: http://davsclaus.blogspot.com/
> Twitter: http://twitter.com/davsclaus
>



--
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus