The date format is usually:

Ddd Mmm dd hh:mm:ss +0000 yyyy

eg:

Tue Nov 16 14:40:25 +0000 2010

What platform are you coding for? In .Net you can use
Convert.ToDateTime on this.

Alternatively, you can use this:

DateTime.Parse(string.Format("{0}-{1}-{2} {3}",
                dateTime.Substring(8, 2), // Day
                dateTime.Substring(4, 3), // Month
                dateTime.Substring(26, 4), // Year
                dateTime.Substring(11, 8))); // Time

Lastly, you may need to make some adjustments for daylight savings at
that time of year, or not... depending or where the data was generated
and where you are. You sometimes get values in the +0000 bit and I
believe this is a minutes offset.

Red

On Nov 16, 7:54 am, Jianshi Huang <jianshi.hu...@gmail.com> wrote:
> Hi,
>
> It seems the date format in create_at field is different among APIs,
>
> Is there any documentation for the format (I couldn't find any except
> issues)?
>
> Can I specify some other formats like iso-8601 or some custom ones?
>
> And what's the best practice for parsing the date string returned by
> twitter APIs?
>
> Jianshi

-- 
Twitter developer documentation and resources: http://dev.twitter.com/doc
API updates via Twitter: http://twitter.com/twitterapi
Issues/Enhancements Tracker: http://code.google.com/p/twitter-api/issues/list
Change your membership to this group: 
http://groups.google.com/group/twitter-development-talk

Reply via email to