开发者

Is it possible to convert the Datetime.Now to Tamil Unicode character in .NET

开发者 https://www.devze.com 2023-02-11 22:23 出处:网络
I\'m wondering if .NET allow multilanguage support for Datet开发者_JAVA技巧ime? I\'m trying to convert the Datetime.Now value to equal Tamil Unicode character.CultureInfo taIN = new CultureInfo(\"ta-

I'm wondering if .NET allow multilanguage support for Datet开发者_JAVA技巧ime?

I'm trying to convert the Datetime.Now value to equal Tamil Unicode character.


CultureInfo taIN = new CultureInfo("ta-IN");
var dateTimeString = DateTime.Now.ToString(taIN);


The DateTime data type stores its information in binary. To convert it to a string, use the ToString method.

This should convert it to a string in the current culture. If that culture is set to produce Tamil date formats, then it will be in Tamil.


If the Tamil culture was installed/availible, you could simply call, for instance,

DateTime.Now.ToString("yyyyddMM", CultureInfo.GetCultureInfo("si-LK","si-LK")); // Sri-Lankan culture info
0

精彩评论

暂无评论...
验证码 换一张
取 消