datetime - Replace Datatype/Timestamp C# -
i have query after split right reccords , works fine datetime , timestamp reccords without separators like:
"20140411085345" need "2014/04/11 08:53:45"
can me?
thanks in advance.
edit:
sorry maybe need more clear:
i have query:
select * table
i use these reccords copy them other database. while records datatype's datetime , timestamp give reccords without separators need datetime , timestamp datatype's separators between them if selected.
if question how convert 1 format another, can use datetime.parseexact()
datetime
first, format whatever you'd like...
var input = "20140411085345"; var timestamp = datetime.parseexact(input, "yyyymmddhhmmss", null); var output = timestamp.tostring("yyyy/mm/dd hh:mm:ss");
fiddle: http://dotnetfiddle.net/fcreza
Comments
Post a Comment