2012-02-17 49 views
1

我有佛教时代(29/02/2555)这是闰年在泰国的日期时间,但在克里斯状态并没有因此,当我到指定的数据集。它为佛教时代的工作?我如何设置佛教时代日期时间数据的格式?这是关于飞跃佛教时代的年度数据集

+0

您正在使用什么平台? – Thilo 2012-02-17 06:46:02

回答

2

不确定你在谈论什么平台,但在C#中处理这些日期是非常简单的,只要你转换和日期时间使用正确的CultureInfo;

var buddhistCultureInfo = new CultureInfo("th"); 
var seCultureInfo = new CultureInfo("sv-se"); 

// Parse a date from Buddhist Era into a DateTime 
DateTime date = DateTime.Parse("29/02/2555", buddhistCultureInfo); 

// "date" here contains the correct date 

// Output as Buddhist Era ("29/2/2555 0:00:00") 
Console.WriteLine(date.ToString(buddhistCultureInfo));    

// Output as Swedish date ("2012-02-29 00:00:00") 
Console.WriteLine(date.ToString(seCultureInfo));      

只要你使用类似的方法转换到/自日期时间,数据集应该有包含日期​​时间没有问题。