System.Xml.XmlConverter.ToDateTime C# (CSharp) Méthode

ToDateTime() static public méthode

static public ToDateTime ( System.Int64 value ) : System.DateTime
value System.Int64
Résultat System.DateTime
        static public DateTime ToDateTime(Int64 value)
        {
            try
            {
                return DateTime.FromBinary(value);
            }
            catch (ArgumentException exception)
            {
                throw DiagnosticUtility.ExceptionUtility.ThrowHelperError(XmlExceptionHelper.CreateConversionException(ToString(value), "DateTime", exception));
            }
        }

Same methods

XmlConverter::ToDateTime ( byte buffer, int offset, int count ) : System.DateTime
XmlConverter::ToDateTime ( string value ) : System.DateTime

Usage Example

Exemple #1
0
 public DateTime ToDateTime()
 {
     if (_type == ValueHandleType.DateTime)
     {
         return(XmlConverter.ToDateTime(GetInt64()));
     }
     if (_type == ValueHandleType.UTF8)
     {
         return(XmlConverter.ToDateTime(_bufferReader.Buffer, _offset, _length));
     }
     return(XmlConverter.ToDateTime(GetString()));
 }
All Usage Examples Of System.Xml.XmlConverter::ToDateTime