c# - How can I format a date in RFC format? -


i need format date in rfc format rss feed. have tried taking date , adding following:

.tostring("ddd, dd mm yyyy hh:mm:ss zzz") 

however seems not valid. great! end result need is, example, mon, 01 jan 2013 gmt

your question bit confusing because example lacks time (but has time-zone). nevertheless, try using mmm month:

.tostring("ddd, dd mmm yyyy hh:mm:ss zzz") 

if don't want time, omit section string:

.tostring("ddd, dd mmm yyyy") 

but since mentioned you're generating string rss feed, use the "r" format specifier generate rfc1123-format date / time string:

.tostring("r") 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -