private string DateFormat(string DateValue, string DateFormat, string RequiredFormat)
{
string result = DateValue;
IFormatProvider provider = CultureInfo.InvariantCulture;
try
{
if (!string.IsNullOrEmpty(DateValue) && !string.IsNullOrEmpty(DateFormat))
result = DateTime.ParseExact(DateValue, DateFormat, provider).ToString(RequiredFormat);
}
catch (Exception ex)
{
throw ex;
}
return result;
}
No comments:
Post a Comment