[Dev] Is there any standard library in java to create a generic date formatter for Solr ?

2015-02-09 Thread Sithumini Senevirathne
Hi All,

I am working on a new feature, Solr based advance search in G-Reg. In my
requirement date is passed in below format before index it in Solr. Below
are the example date being passed and the standard Solr date format.

String dateFormat = "Mon Feb 09 02:05:26 IST 2015";
The standard Solr format is "*-MM-dd'T'HH:mm:ss'Z*'"

As the solution I tried SimpleDateFormat but the problem with this approach is,
its not a generic solution to support various formats. So looking for a
generic one available, which can cater to any date format.

Is there a standard library to achieve this ?

Thanks,
Regards,
Sithumini
-- 
-- 
Sithumini Senevirathne
Software Engineer
WSO2 Inc. - lean . enterprise . middleware |  wso2.com

email: sithumi...@wso2.com,   mobile: +94 756977999
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Is there any standard library in java to create a generic date formatter for Solr ?

2015-02-09 Thread Thusitha Thilina Dayaratne
May be you can give a try on Natty 

On Mon, Feb 9, 2015 at 1:54 PM, Sithumini Senevirathne 
wrote:

> Hi All,
>
> I am working on a new feature, Solr based advance search in G-Reg. In my
> requirement date is passed in below format before index it in Solr. Below
> are the example date being passed and the standard Solr date format.
>
> String dateFormat = "Mon Feb 09 02:05:26 IST 2015";
> The standard Solr format is "*-MM-dd'T'HH:mm:ss'Z*'"
>
> As the solution I tried SimpleDateFormat but the problem with this
> approach is, its not a generic solution to support various formats. So looking
> for a generic one available, which can cater to any date format.
>
> Is there a standard library to achieve this ?
>
> Thanks,
> Regards,
> Sithumini
> --
> --
> Sithumini Senevirathne
> Software Engineer
> WSO2 Inc. - lean . enterprise . middleware |  wso2.com
>
> email: sithumi...@wso2.com,   mobile: +94 756977999
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>


-- 
Thusitha Dayaratne
Software Engineer | WSO2 Inc

Emailthusit...@wso2.com
Mobile  +94712756809
Blog  alokayasoya.blogspot.com
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev


Re: [Dev] Is there any standard library in java to create a generic date formatter for Solr ?

2015-02-09 Thread Hasanthi Purnima Dissanayake
Hi Sithumini,
I have used Joda-time library instead of SimpleDateFormat for formatting
dates. You may able to use it.
http://www.joda.org/joda-time/
http://blog.smartbear.com/programming/date-and-time-manipulation-in-java-using-jodatime/


Hasanthi Dissanayake

Software Engineer | WSO2

E: hasan...@wso2.com 
M :0718407133| http://wso2.com 

On Mon, Feb 9, 2015 at 8:19 PM, Thusitha Thilina Dayaratne <
thusit...@wso2.com> wrote:

> May be you can give a try on Natty 
>
> On Mon, Feb 9, 2015 at 1:54 PM, Sithumini Senevirathne <
> sithumi...@wso2.com> wrote:
>
>> Hi All,
>>
>> I am working on a new feature, Solr based advance search in G-Reg. In my
>> requirement date is passed in below format before index it in Solr. Below
>> are the example date being passed and the standard Solr date format.
>>
>> String dateFormat = "Mon Feb 09 02:05:26 IST 2015";
>> The standard Solr format is "*-MM-dd'T'HH:mm:ss'Z*'"
>>
>> As the solution I tried SimpleDateFormat but the problem with this
>> approach is, its not a generic solution to support various formats. So 
>> looking
>> for a generic one available, which can cater to any date format.
>>
>> Is there a standard library to achieve this ?
>>
>> Thanks,
>> Regards,
>> Sithumini
>> --
>> --
>> Sithumini Senevirathne
>> Software Engineer
>> WSO2 Inc. - lean . enterprise . middleware |  wso2.com
>>
>> email: sithumi...@wso2.com,   mobile: +94 756977999
>>
>> ___
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Thusitha Dayaratne
> Software Engineer | WSO2 Inc
>
> Emailthusit...@wso2.com
> Mobile  +94712756809
> Blog  alokayasoya.blogspot.com
>
>
> ___
> Dev mailing list
> Dev@wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/dev
>
>
___
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev