static public string ChangeTaiwanCalendar(this DateTime x, string format)
{
DateTime now = x;
TaiwanCalendar tc = new TaiwanCalendar();
Regex regex = new System.Text.RegularExpressions.Regex(@"[yY]+");
format = regex.Replace(format, tc.GetYear(x).ToString("000"));
return x.ToString(format);
}
轉自 http://demo.tc/Post/579
沒有留言:
張貼留言