home / software / tips and tricks / How to convert to 'DateTime' without 'InvalidCastException.' exception?

How to convert to 'DateTime' without 'InvalidCastException.' exception?

Updated:  08/18/2014 17:08 PM
Author:  Shiju Mathews

Status:    Resolved.


use DateTime.TryParse Method (String, DateTime) method.

Converts the specified string representation of a date and time to its DateTime equivalent and returns a value that indicates whether the conversion succeeded.

Syntax:



Tags: How to convert to 'DateTime' without 'InvalidCastException.' exception?
Updated on: November 2024