DateTime dt = DateTime.ParseExact(yourObject.ToString(), "MM/dd/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);
string s = dt.ToString("dd/M/yyyy", CultureInfo.InvariantCulture);
More Related Contents:
- Creating a blocking Queue in .NET?
- Get the correct week number of a given date
- Why doesn’t C# infer my generic types?
- How to get the current user in ASP.NET MVC
- How do I get the title of the current active window using c#?
- Validate image from file in C#
- Is there any benefit of using an Object Initializer?
- How to compare two rich text box contents and highlight the characters that are changed?
- How do you retrieve a list of logged-in/connected users in .NET?
- Solid FFmpeg wrapper for C#/.NET
- Can I pass constructor parameters to Unity’s Resolve() method?
- Single-assembly multi-language Windows Forms deployment (ILMerge and satellite assemblies / localization) – possible?
- What is the use of the ArraySegment class?
- What exactly is an Assembly in C# or .NET?
- When would you use delegates in C#? [closed]
- WPF equivalent to TextRenderer
- An efficient way to Base64 encode a byte array?
- Convert string to Brushes/Brush color name in C#
- Remove C# attribute of a property dynamically
- CORS Support within WCF REST Services
- How to set read permission on the private key file of X.509 certificate from .NET
- Does String.GetHashCode consider the full string or only part of it?
- Why does StyleCop recommend prefixing method or property calls with “this”?
- How would I sort a list of files by name to match how Windows Explorer displays them?
- .NET (3.5) formats times using dots instead of colons as TimeSeparator for it-IT culture?
- Reflection.Emit vs CodeDOM
- Why choose a static class over a singleton implementation?
- Upload CSV file to SQL server
- The component does not have a resource identified by the uri
- Change ComboBox Border Color in Windows Forms