Getting a DateTimeFormatter that parses a DateTime from a String containing seconds.

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Getting a DateTimeFormatter that parses a DateTime from a String containing seconds.

Njal Karevoll
How can I create a DateTimeFormatter that can format a string that contains the number of seconds from the unix epoch?

I've looked at the DateTimeFormatterBuilder, but I can't see how/where I should do the actual parsing.
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Joda-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/joda-interest
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Getting a DateTimeFormatter that parses a DateTime from a String containing seconds.

jodastephen
DateTimeFormatterBuilder is used to create the DateTimeFormatter which
is where the actual parse method is. Unfortunately, I don't think that
unix seconds is one of the options in Joda-Time. You could just use an
Integer parse though. If you want to integrate it, you'd need to
implement DateTimeParser interface.

Stephen



On 21 September 2011 15:13, Njal Karevoll <[hidden email]> wrote:

> How can I create a DateTimeFormatter that can format a string that contains the number of seconds from the unix epoch?
>
> I've looked at the DateTimeFormatterBuilder, but I can't see how/where I should do the actual parsing.
> ------------------------------------------------------------------------------
> All the data continuously generated in your IT infrastructure contains a
> definitive record of customers, application performance, security
> threats, fraudulent activity and more. Splunk takes this data and makes
> sense of it. Business sense. IT sense. Common sense.
> http://p.sf.net/sfu/splunk-d2dcopy1
> _______________________________________________
> Joda-interest mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/joda-interest
>

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2dcopy1
_______________________________________________
Joda-interest mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/joda-interest
Loading...