コード例 #1
0
 public static bool FromRocDateToAdTry(string s, out DateTime result, string format = "yyy.MM.dd")
 {
     if (!DateTime.TryParseExact(s, format, CultureInfo.InvariantCulture, DateTimeStyles.None, out result))
     {
         return(false);
     }
     result = CtkTimeUtil.FromRocDateToAd(result);
     return(true);
 }
コード例 #2
0
 /// <summary>
 /// Sign Week, e.q. w202053
 /// </summary>
 /// <param name="dt"></param>
 /// <returns></returns>
 public static string ToSign1Week(DateTime dt)
 {
     var weekOfYear = CtkTimeUtil.WeekOfYear(dt); return(string.Format("w{0}{1:00}", dt.ToString("yyyy"), weekOfYear));
 }