Stephen,

thanks for the answer - I already have some code to accomplish the task 
(however, it's not very generic - basically counting dashes an colons). 
Maybe it is easy to incoporate this useful feature in future jodatime 
releases - the parsers for ISO DateTime String might already contain the 
required logic.

Matthias

Am 04.05.2011 14:26, schrieb Stephen Colebourne:
> There is no way in Joda-Time to "reverse engineer" a format from a string.
>
> You could start with a list of possible formats, and try each one to
> see which work and which don't.
>
> Stephen
>
>
> 2011/5/2 Matthias Müller<matthias_muel...@tu-dresden.de>:
>> Hi jodatime folks,
>>
>> is there a convenient way to obtain the DateTimeFormat from a dateTime
>> String (e.g. 2001-01-01)? I have to create a list of valid timestamps
>> from an initial _baseDate_, and a given increment (e.g. "month").
>> The outputs shall be printed later on in the same format as _baseDate_.
>>
>> Thanks,
>> Matthias
>>
>>
>>
>> ------------------------------------------------------------------------------
>> WhatsUp Gold - Download Free Network Management Software
>> The most intuitive, comprehensive, and cost-effective network
>> management toolset available today.  Delivers lowest initial
>> acquisition cost and overall TCO of any competing solution.
>> http://p.sf.net/sfu/whatsupgold-sd
>> _______________________________________________
>> Joda-interest mailing list
>> Joda-interest@lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/joda-interest
>>
>
> ------------------------------------------------------------------------------
> WhatsUp Gold - Download Free Network Management Software
> The most intuitive, comprehensive, and cost-effective network
> management toolset available today.  Delivers lowest initial
> acquisition cost and overall TCO of any competing solution.
> http://p.sf.net/sfu/whatsupgold-sd
> _______________________________________________
> Joda-interest mailing list
> Joda-interest@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>


-- 
Matthias Müller
Dipl.-Geogr. | Research Associate

Technische Universität Dresden
Geoinformation Systems
01062 Dresden

Phone: +49 351 463-31953
Fax: +49 351 463-35879
Mail: matthias_muel...@tu-dresden.de

www: http://tu-dresden.de/fgh/geo/gis

------------------------------------------------------------------------------
WhatsUp Gold - Download Free Network Management Software
The most intuitive, comprehensive, and cost-effective network 
management toolset available today.  Delivers lowest initial 
acquisition cost and overall TCO of any competing solution.
http://p.sf.net/sfu/whatsupgold-sd
_______________________________________________
Joda-interest mailing list
Joda-interest@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/joda-interest

Reply via email to