A classe DateTime é membro do Namespace System, temos agora umas listas das
propriedades e métodos desta classe, e o formato que eles retornam.
Propriedades:
Método, Valor retornado
Date DateTime
Day Int32
DayOfWeek Int32
DayOfYear Int32
Hour Int32
Millisecond Int32
Minute Int32
Month Int32
Now DateTime
Second Int32
Ticks Int64
TimeOfDay TimeSpan
Today DateTime
Year Int32
Métodos :
Método, Valor retornado
Add ( TimeSpan value ) DateTime
AddDays ( Double value ) DateTime
AddHours ( Double value ) DateTime
AddMilliseconds ( Double value ) DateTime
AddMinutes ( Double value ) DateTime
AddMonths ( Int32 months ) DateTime
AddSeconds ( Double value ) DateTime
AddTicks ( Int64 value ) DateTime
AddYears ( Int32 value )Â DateTime
Compare ( DateTime t1 , DateTime t2 ) Int32
CompareTo ( Object value ) Int32
DaysInMonth ( Int32 year , Int32 month ) Int32
Equals ( Object value ) Boolean
Equals ( DateTime t1 , DateTime t2 ) Boolean
Format ( String format , IServiceObjectProvider sp ) String
FromFileTime ( Int64 fileTime ) DateTime
FromOADate ( Double d ) DateTime
FromString ( String s ) DateTime
GetAllDateTimes ( Char format , IServiceObjectProvider isop ) String[]
GetAllDateTimes ( IServiceObjectProvider isop ) String[]
GetAllDateTimes ( ) String[]
GetAllDateTimes ( Char format ) String[]
GetDateTimeFormats ( ) String[]
GetDateTimeFormats ( IServiceObjectProvider isop ) String[]
GetDateTimeFormats ( Char format , IServiceObjectProvider isop ) String[]
GetDateTimeFormats ( Char format ) String[]
GetHashCode ( ) Int32
GetTypeCode ( ) TypeCode
IsLeapYear ( Int32 year ) Boolean
Parse ( String s , DateTimeFormatInfo dtfi ) DateTime
Parse ( String s ) DateTime
ParseExact ( String s , String format , DateTimeFormatInfo dtfi , DateTimeStyles
style ) DateTime
ParseExact ( String s , String format , DateTimeFormatInfo dtfi ) DateTime
Subtract ( DateTime value ) TimeSpan
Subtract ( TimeSpan value ) DateTime
ToBoolean ( ) Boolean
ToByte ( ) Byte
ToChar ( ) Char
ToDateTime ( ) DateTime
ToDecimal ( ) Decimal
ToDouble ( ) Double
ToFileTime ( ) Int64
ToInt16 ( ) Int16
ToInt32 ( ) Int32
ToInt64 ( ) Int64
ToLocalTime ( ) DateTime
ToLongDateString ( ) String
ToLongTimeString ( ) String
ToOADate ( ) Double
ToSByte ( ) SByte
ToShortDateString ( ) String
ToShortTimeString ( ) String
ToSingle ( ) Single
ToString ( ) String
ToString ( DateTime dt ) String
ToType ( Type type ) Object
ToUInt16 ( ) UInt16
ToUInt32 ( ) UInt32
ToString ( DateTime dt ) String
ToType ( Type type ) Object
ToUInt16 ( ) UInt16
ToUInt32 ( ) UInt32
ToUInt64 ( ) UInt64
ToUniversalTime ( ) DateTime
Esperemos que fique elucidado em relação a esta classe, mexer com datas e Horas está mais potente que nunca.
Escrito por João Vieira