• Skip to primary navigation
  • Skip to content
  • Skip to footer
Chris Miller's 5th Blog
  • Posts
  • Categories
  • Tags
  • About
    Chris Miller

    Chris Miller

    I am a Microsoft MVP, a Pluralsight Author, a Xamarin Certified Mobile Developer for iOS and Android, and the leader of the Tech Valley .NET User Group.

    • Albany, NY
    • Website
    • BlueSky
    • Pluralsight
    • GitHub
    • LinkedIn
    • Instagram
    • Microsoft MVP
    • Stack Overflow
    • Reddit
    • Links
      • BlueSky
      • Pluralsight
      • GitHub

    String Date Validator

    less than 1 minute read

    String Date Validator

    Mark Wagner has a nice helper function for validating a date.

    private static bool IsDate(string sDate)
    {
    DateTime dt;
    bool isDate = true;

    <span>try<br /> {<br /> dt = DateTime.Parse(sDate);<br /> }<br /> catch<br /> {<br /> isDate = false;<br /> }</span>
    
    <span>return isDate;<br />}</span>
    

    Updated: April 7, 2005

    Twitter Facebook LinkedIn
    Previous Next

    Comments

    You May Also Enjoy

    Using PowerShell to convert VTT to SRT

    5 minute read

    Converting between VTT and SRT So I have to convert between VTT and SRT a few times a year. I’m lazy and forgetful so I decided to script the tasks with Powe...

    Command for keeping your phone awake while plugged in

    2 minute read

    Usually when I’m writing .NET MAUI code for Android, I use an emulator to test the code. It’s fast and there are fewer things that can go wrong. And most o...

    Breaking and then fixing my app’s CFBundleShortVersionString

    4 minute read

    So I had this bug reported where the app was reporting the wrong version number. Only for iOS, it was correct on Android. It’s an app created with .NET MAU...

    Poka-yoke

    2 minute read

    So I used poka-yoke (ポカヨケ) in a conversation yesterday. I am working on an update to an app that uses a web service. Under an extreme edge condition, the a...

    • Bluesky
    • GitHub
    • LinkedIn
    • Instagram
    • Microsoft MVP
    • Feed
    © 2025 Chris Miller's 5th Blog. Powered by Jekyll & Minimal Mistakes.