转换日期时间从英语翻译成西班牙语 [英] Convert DateTime from English to Spanish
本文介绍了转换日期时间从英语翻译成西班牙语的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有谁知道如何转换的DateTime
从英语到西班牙
Does anybody know how to convert a DateTime
from English to Spanish?
例如转换:
周一,2011年1月1日
Monday, January 01, 2011
到
Lunes酒店,Enero 01,2011 ???
Lunes, Enero 01, 2011 ???
先谢谢了。
推荐答案
Yyou可以使用的CultureInfo做到这一点,如果你正在运行的线程设置当前文化日期会在正确的文化
http://msdn.microsoft格式化.COM / EN-US /在vb.net
Yyou can use CultureInfo to do this, if you set the current culture in the running thread the date will format in the correct culture http://msdn.microsoft.com/en-us/library/5hh873ya.aspx
Dim TheDate As DateTime = DateTime.Parse("January 01 2011")
Thread.CurrentThread.CurrentCulture = New CultureInfo("es-ES")
MsgBox(TheDate.ToLongDateString)
或C#
DateTime TheDate = DateTime.Parse("January 01 2011");
Thread.CurrentThread.CurrentCulture = new CultureInfo("es-ES");
Interaction.MsgBox(TheDate.ToLongDateString());
这篇关于转换日期时间从英语翻译成西班牙语的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文