C# change formatting for a single DateTime -
i creating datetimes used 3rd party library (on have of course of study no control). using 3rd party library write files, including datetimes creating.
i print dates in different format have no command on how datetime converted 3rd party , cannot alter civilization info between conversion of each datetime, neither can inherit datetime override tostring (like no 1 can).
is there way bind specific formatting datetime each phone call tostring method utilize formatting ?
datetime firstdate = new datetime(2013, 02, 07); //i datetime printed way: 2013-02-07 datetime seconddate = new datetime(2013, 02, 07); //i datetime printed way: thursday, feb 07, 2013 thirdpartylib.setfirstdate(firstdate); thirdpartylib.setseconddate(seconddate); thirdpartylib.printbothdate(); //this method convert both datetime in strings
with info given in question, way solve implementing own printing library.
or if 3rd party library extendable (i uncertainty since mentioned have no command on it) override printbothdate()
suit needs.
c# datetime formatting
No comments:
Post a Comment