Introduction
Working With Custom Time Strings in C#
Technology

Working With Custom Time Strings in C#

Let's say we need to process some external data where the format and contents of the files are out of our control. To make matters worse, what if those same external files store tiemstamps in a foreign format that DateTime.Parse() does not understand?
It would be ill-advised to keep the dates in string format due to the level of robust date processing capabilities present in .NET.
Luckily, .NET provides a nice way to create custom date formats so any date string can be easily converted into a DateTime object.

Now, we have the benefit of leveraging both custom timestamp values and .NET's built in DateTime Functionality.

Do you think this might be useful on your current project? Learn more about DateTime.ParseExact() here here.

Image From: kenyonreview.org

Robert Greiner
Author

Robert Greiner

Professional optimist. Passionate about cultivating high-performing teams @ scale by integrating the timeless wisdom of the past with the marvel of today's emergent technology in a practical way.

View Comments
Next Post

Getting Started With Git and TortoiseGit on Windows

Previous Post

Using .NET to Monitor a Directory for Changes

Subscribe for free

Subscribe to my newsletter and get the latest posts delivered right to your inbox for free. I don't spam and your email won't be shared with third-parties.

Thanks for subscribing!

Check your inbox to confirm your subscription.

Please enter a valid email address!