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); }
/// <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)); }