public static String convertDateFromInDayFormat(atring stringDate, string hhmmss, bool inUtc) { if (stringDate == null || stringDate.Length == 0) { return(""); } StringBuilder sb = null; try { DateTime date = DateTime.ParseExact(stringDate, PATTERN_YYYYMMDD, CultureInfo.InvariantCulture); sb = new StringBuilder(date.ToString(PATTERN_YYYYMMDD)); sb.Append('T'); sb.Append(hhmmss); if (inUtc) { sb.Append('Z'); } return(sb.ToString()); } catch (Exception) { } return(""); }
public static String convertDateFromInDayFormat(atring stringDate, string hhmmss, bool inUtc) { if (stringDate == null || stringDate.Length == 0) return ""; StringBuilder sb = null; try { DateTime date = DateTime.ParseExact(stringDate, PATTERN_YYYYMMDD, CultureInfo.InvariantCulture); sb = new StringBuilder(date.ToString(PATTERN_YYYYMMDD)); sb.Append('T'); sb.Append(hhmmss); if (inUtc) { sb.Append('Z'); } return sb.ToString(); } catch (Exception) { } return ""; }