I’m using LastWriteTime property for a file which I use, to print the last modified time.
However, here when I use I get a value like
“2/12/2011 11:58:45 AM”.
(i) Can you pls help to ignore seconds here meaning the output should be like:
2/12/2011 11:58 AM
(ii) Also, how do I ensure that I’m taking care of time zones as in the file LastWriteTime could be as per other GEO timings. Can you pls help to take care of this?
(iii) Also how to take care of Culture problems here as CurrentCulture would be different for machines?
The patterns for DateTime.ToString ( ‘g’ ) :
Source: DateTime.ToString Patterns