小编che*_*tan的帖子

如何在 C# 中更改月、日、年的日期格式

我有以下代码行。字符串类型的日期格式为29/11/2017。我想要它作为November 29, 2017. 我尝试添加 String.Format 但它在 pdf 中显示相同的 29/11/2017 。

cellValDate.AddElement(new Phrase(String.Format("{0:dddd, MMMM d, yyyy}",
                       txtDate.Text, CultureInfo.CreateSpecificCulture("en-US")), 
                       new iTextSharp.text.Font(iTextSharp.text.Font.FontFamily.HELVETICA, 
                       10, iTextSharp.text.Font.NORMAL)));
Run Code Online (Sandbox Code Playgroud)

c#

3
推荐指数
1
解决办法
8117
查看次数

标签 统计

c# ×1