how to uppercase date and month first letter of ToLongDateString() result in es-mx Culture?

前端 未结 4 692
栀梦
栀梦 2021-01-05 05:45

currently i obtain the below result from the following C# line of code when in es-MX Culture

   Thread.CurrentThread.CurrentCulture =
     Thread.CurrentThr         


        
4条回答
  •  猫巷女王i
    2021-01-05 06:19

    The pattern of LongDate for Spanish (Mexico) is

    ffffdd, dd' de 'MMMM' de 'yyyy

    according to Thread.CurrentThread.CurrentCulture.DateTimeFormat.LongDatePattern. I guess you just have to manually convert the initial letters of the day and month to uppercase or you can use Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase and then replace "De" with "de".

提交回复
热议问题