Time does not have format. It is represented by the structure
System.DateTime
without any strings, in a binary form, exactly as it should be. You should understand how to work with data, not with strings representing data. If you need remember some point of time, you should store this time as
System.DateTime
. You should use date-time formats only when you need to present time on screen in text form, which is, strictly speaking, is not a must: you could show some kind of calendar or purely graphical watch. Only when presented on screen (or in similar situations), this data should be presented in the culture-dependent manner.
Further steps depend on what do you mean by "save". If you mean saving in some persistent storage like a file or a database, you will need some persistent presentation, but this has nothing to do with what you show on screen and hence with date-time formats. It should be saved in some culture-independent format, such as RFC1123,
sortable or
universal sortable patterns, please see:
http://msdn.microsoft.com/en-us/library/az4se3k1.aspx[
^].
Normally, you do it not "manually", but using one or another
data-agnostic serializer, which takes care about presentation detail for you. On approach I would recommend is based on
Data Contract. Please see:
http://msdn.microsoft.com/en-us/library/ms733127.aspx[
^].
—SA