简体   繁体   中英

ASP.NET MVC RSS feed datetime format

如何获得RSS feed的这种日期时间格式?

Mon, 06 Sep 2009 16:45:00 +0000

I think you want DateTime.Now.ToString("r") ,
where the 'r' indicates formatting following the RFC1123 pattern.

It will not (always) display an offset as +000, it will use 'GMT' and other standardized tz names.

As far as I can tell this one of the rare case where you don't have to specify an IFromatProvider.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM