c# - Converting date time to string with separator "T" -


how convert date object "t" separate date , time

e.g., 2013/07/22t09:43:21 instead of 2013/07/22 09:43:21

use datetime.tostring custom format string contains t @ desired position.

var date = new datetime(2013, 07, 22, 09, 43, 21); var output = date.tostring("yyyy/mm/ddthh:mm:ss", cultureinfo.invariantculture); 

note i've used cultureinfo.invariantculture avoid / gets replaced actual culture's date-separator.

demo 2013/07/22t09:43:21


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -