Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Niklas Hjelm 104 posts 125 karma points
    Jan 03, 2012 @ 17:46
    Niklas Hjelm
    0

    Eng date in rss feed

    Hi!

    I've created a simple RSS feed using razor. However I'm having some trouble with the culture for my date.

    <pubDate>@item.CreateDate.ToString("ddd, dd MMM yyyy HH':'mm':'ss zzz")</pubDate>


    This gets me the correct RSS date format but "ddd" is in my local culture (swe). Is there a way to force it to be in english so I can get it to validate?

    Thanks / Niklas

  • Sebastiaan Janssen 5061 posts 15544 karma points MVP admin hq
    Jan 03, 2012 @ 17:49
    Sebastiaan Janssen
    0

    You'll have to change the current culture as well (as per this MSDN post): 

    @{
         Thread.CurrentThread.CurrentCulture = new CultureInfo( "en-US", false );
  • Niklas Hjelm 104 posts 125 karma points
    Jan 03, 2012 @ 19:04
    Niklas Hjelm
    0

    Works perfect! Thanks!

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies