DateTime Format for Get_Slideshow (and variants)

28 views
Skip to first unread message

Aarononontheweb

unread,
Apr 25, 2010, 5:00:14 PM4/25/10
to SlideShare Developers
Hi,

I'm trying to write a .NET client for a SlideShare analytics
application and one of the fields I'm trying to capture is the date a
user's presentation was created.

Currently the DateTime format for the "Created" field in a
Get_Slideshow response (see the documentation here:
http://www.slideshare.net/developers/documentation) looks something
like this:

<Created>Wed Feb 10 20:13:54 -0600 2010</Created>

(Day of week name, Month name, Weekday, Hours:Minutes:Seconds, GMT
offset?, Year)

I'm having a difficult time finding a non-awkward way to parse this
response format into a standard day/month/year or month/day/year
format. .NET's own DateTime.Parse() and DateTime.ParseExact() native
methods both fail on this format, which is amazing considering how
robust and flexible both of those parsing methods are.

While I think ultimately this response format reflects some really
poor decision making on the part of SlideShare's API development team
(seriously, why should parsing a date be this complicated?), I was
wondering if any of the other developmers on these boards have
developed a robust workaround method for parsing it. Developing a
giant switch statement for mapping SlideShare's three-letter month
codes to a numeric month number, among other gruesome workarounds,
leaves me wanting.

--
You received this message because you are subscribed to the Google Groups "SlideShare Developers" group.
To post to this group, send email to slideshare...@googlegroups.com.
To unsubscribe from this group, send email to slideshare-devel...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/slideshare-developers?hl=en.

Jonathan Boutelle

unread,
Apr 26, 2010, 4:22:45 PM4/26/10
to slideshare...@googlegroups.com
Wow that is pretty nasty!

I agree that this format sucks (my fault). We should probably use standard Unix time format in GMT. Or does anyone have other suggestions?

I can't promise this will be done very soon (i.e. soon enough to solve your problem), but filing a bug for it so that we make sure to revisit this.

Regards,
-Jon Boutelle
CTO, SlideShare

Aarononontheweb

unread,
Jun 17, 2010, 12:03:09 PM6/17/10
to SlideShare Developers
By the way, someone who read my blog contributed a .NET method which
does parse this format easily:

string date = "Thu May 06 14:10:46 -0500 2010";
DateTime dt = DateTime.ParseExact(date, "ddd MMM dd HH:mm:ss K yyyy",
System.Globalization.CultureInfo.InvariantCulture);


On Apr 26, 1:22 pm, Jonathan Boutelle <jonathanboute...@gmail.com>
wrote:
> Wow that is pretty nasty!
>
> I agree that this format sucks (my fault). We should probably use standard
> Unix time format in GMT. Or does anyone have other suggestions?
>
> I can't promise this will be done very soon (i.e. soon enough to solve your
> problem), but filing a bug for it so that we make sure to revisit this.
>
> Regards,
> -Jon Boutelle
> CTO, SlideShare
>
> > slideshare-devel...@googlegroups.com<slideshare-developers%2B­unsub...@googlegroups.com>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/slideshare-developers?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups "SlideShare Developers" group.
> To post to this group, send email to slideshare...@googlegroups.com.
> To unsubscribe from this group, send email to slideshare-devel...@googlegroups.com.
> For more options, visit this group athttp://groups.google.com/group/slideshare-developers?hl=en.- Hide quoted text -
>
> - Show quoted text -
Reply all
Reply to author
Forward
0 new messages