Kalyani Shevale

Kalyani Shevale

  • NA
  • 3.2k
  • 711.6k

Date format change

Mar 22 2019 4:23 AM
below in code if
f.StartDate=22/10/2019
date available this date convert in any machine format in c# 
 
  1. DateTime dt1StartPaymentDate = DateTime.ParseExact(f.StartDate, "dd/MM/yyyy", System.Globalization.CultureInfo.InvariantCulture);  
  2.          string startdate = dt1StartPaymentDate.ToString("MM/dd/yyyy");  
  3.          string starttime = f.StartTime;  
  4.          string startdatetime = startdate + " " + starttime;  
  5.          DateTime startingtime = Convert.ToDateTime(startdatetime);  
 

Answers (2)