c# - DateTime Parse from PDT -
i have string contains date shown below
string datetime = "18-aug-2016 12:02:44 pdt";
i want converted below format
output = 2016-08-18t00:02:44-07:00
i tried below code, still need modify required output
string mydate = datetime.replace("pdt", "-0700"); datetime dt = convert.todatetime(mydate);
string datetime = "18-aug-2016 12:02:44 pdt"; string mydate = datetime.replace("pdt", "-0700"); datetime dt = convert.todatetime(mydate); console.writeline("the current date , time: {0:o}", dt);
gives me following output:
the current date , time: 2016-08-18t09:02:44.0000000+02:00
Comments
Post a Comment