C# Convert ToChar(DateTime)
Description
Convert ToChar(DateTime)
calling this method always
throws InvalidCastException.
Syntax
Convert.ToChar(DateTime)
has the following syntax.
public static char ToChar(
DateTime value
)
Parameters
Convert.ToChar(DateTime)
has the following parameters.
value
- The date and time value to convert.
Returns
Convert.ToChar(DateTime)
method returns This conversion is not supported. No value is returned.
Example
using System;/* ww w . j a va2 s.c om*/
public class MainClass{
public static void Main(String[] argv){
System.Console.WriteLine(Convert.ToChar(DateTime.Now));
}
}
The code above generates the following result.