Skip to content

Working With Custom Time Strings in C#

Robert Greiner
Robert Greiner
1 min read

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

Please consider subscribing, it's free.
Technology

Robert Greiner Twitter

Professional optimist. I write a weekly newsletter for humans at the intersection of business, technology, leadership, and career growth.


Related Posts

Members Public

AI Rule #1 - Customer First

In 1985, Warren Buffett wisely said, "The first rule of investment is don't lose. And the second rule of investment is don't forget the first rule, and that's all the rules there are." Similarly, the first rule of AI investment is to

AI Rule #1 - Customer First
Members Public

Navigating the Upside Down as a Technology Leader

Ideas for leading technology organizations with confidence and creativity.

Navigating the Upside Down as a Technology Leader
Members Public

Artist for a Day

The future of creative output is multiplied by AI.

Artist for a Day