Convert standard Datetime format in given format using c# -


i need convert datetime in c# specific format 2002-09-24+06:00.

i want result in datetime variable , not string since need pass soap call expecting datetime in format.

how can result?

a datetime object doesn't have format , stores date value. , if webservice expect special format, i'm shure wants string.

you can special formatted string this:

string.format("{your_format}", your_datetime_object); 

if soap need type xs:datetime try following formatting string:

your_datetime_object.tostring("o") 

this give format: yyyy-mm-ddthh:mm:ss


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -