I have a date/time string that looks like the following:
Wed Sep 21 2011 12:35 PM Pacific
How do I format a DateTime to look like this?
Thank you!
The bit before the time zone is easy, using a custom date and time format string:
string text = date.ToString("ddd MMM dd yyyy hh:mm t");
However, I believe that the .NET date/time formatting will not give you the "Pacific" part. The best it can give you is the time zone offset from UTC. That's fine if you can get the time zone name in some other way.
A number of TimeZoneInfo
identifiers include the word Pacific, but there isn't one which is just "Pacific".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With