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