CorDateTime

CorDateTime


Represents a point in time.


Implements:

IComparable 
IFormattable 
IObject 

Public:

Properties:

NameDescription
 DateOnly (get) Returns the date portion of the current date representation.  
 Day (get) Returns the Day part of the current date representation.  
 DayOfWeek (get) Returns the day of the week for the current date.  
 DayOfYear (get) Returns the day within the calendar year.  
 Hour (get) Returns the Hour part of the current date representation.  
 IsDayLightSavingsTime (get) Returns if this CorDateTime instance is currently in daylight savings time.  
 Kind (get) Returns the DateTimeKind of CorDateTime.  
 Millisecond (get) Returns the Millisecond part of the current date representation.  
 Minute (get) Returns the Minute part of the current date representation.  
 Month (get) Returns the Month part of the current date representation.  
 Second (get) Returns the Second part of the current date representation.  
 Ticks (get) Returns the whole date represented in ticks.  
 TimeOfDay (get) Returns the time portion of the current date representation.  
 TotalMilliseconds (get) Returns the whole date represented in milliseconds.  
 Year (get) Returns the Year part of the current date representation.  

Methods:

NameDescription
 Add Adds a specified amount of time to the current date, returning a new CorDateTime instance with the calcuated value.  
 AddDays Adds a specified number of days to the current date, returning a new CorDateTime instance with the calcuated value.  
 AddHours Adds a specified number of hours to the current date, returning a new CorDateTime instance with the calcuated value.  
 AddMilliseconds Adds a specified number of milliseconds to the current date, returning a new CorDateTime instance with the calcuated value.  
 AddMinutes Adds a specified number of minutes to the current date, returning a new CorDateTime instance with the calcuated value.  
 AddMonths Adds a specified number of months to the current date, returning a new CorDateTime instance with the calcuated value.  
 AddSeconds Adds a specified number of seconds to the current date, returning a new CorDateTime instance with the calcuated value.  
 AddTicks Adds a specified number of ticks to the current date, returning a new CorDateTime instance with the calcuated value.  
 AddYears Adds a specified number of years to the current date., returning a new CorDateTime instance with the calcuated value.  
 CompareTo Compares this instance to a passed in Date or CorDateTime instance.  
 Equals Returns a boolean indicating if the value and this object instance are the same date.  
 EqualTo Determines if this instance is equal to another CorDateTime object.  
 GetHashCode Returns a pseudo-unique number identifying this instance.  
 GreaterThan Determines if this instance is greater than another CorDateTime object.  
 GreaterThanOrEqualTo Determines if this instance is greater than or equal to another CorDateTime object.  
 LessThan Determines if this instance is less than another CorDateTime object.  
 LessThanOrEqualTo Determines if this instance is less than or equal to another CorDateTime object.  
 NotEqualTo Determines if this instance is not equal to another CorDateTime object.  
 Subtract Subtracts either a CorDateTime instance or a TimeSpan instance from this CorDateTime instance.  
 ToBinary Returns a 64-bit representation of the time and kind.  
 ToFileTime Converts the CorDateTime to a FileTime representation, adjusting for timezone.  
 ToFileTimeUtc Converts the CorDateTime to a FileTime representation, ignoring the timezone offset.  
 ToLocalTime Returns a CorDateTime with the timezone offset applied to this instance.  
 ToLongDateString Returns the date formatted to the current cultures long date pattern.  
 ToLongTimeString Returns the time formatted to the current cultures long time pattern.  
 ToOADate Converts the current instance to an Ole Automation date representation that is normally used in Visual Basic.  
 ToShortDateString Returns the date formatted to the current cultures short date pattern.  
 ToShortTimeString Returns the time formatted to the current cultures short time pattern.  
 ToString Formats a CorDateTime object or Date value in the pattern specified by the formatting command. If no command is specified, then G' is assumed. If the command cannot be found, then a custom pattern is assumed.  
 ToUniversalTime Returns a CorDateTime with the timezone offset removed from this instance.  

Remarks

The CorDateTime class can represent a point in time from 1/1/0001 12:00:00 AM to 12/31/9999 11:59:59 PM. The time is represented in a gregorian calendar set.

Examples

The following example code creates and displays a CorDateTime object with various output formats.

Public Sub Main()
    Dim dt As CorDateTime
    
    Set dt = NewDateTime(2003, 2, 3, 8, 0, 0)
    
    Debug.Print dt.ToString
    Debug.Print dt.ToShortDateString
    Debug.Print dt.ToLongDateString
    Debug.Print dt.ToShortTimeString
    Debug.Print dt.ToLongTimeString
End Sub

' This code produces the following output.
'
'    2/3/2003 8:00:00 AM
'    2/3/2003
'    Monday, February 3, 2003
'    8:00 AM
'    8:00:00 AM

See Also

Project CorLib Overview

Class CorDateTime Overview

Constructors

CorDateTimeStatic

DateTimeFormatInfo

TimeSpan

IComparable

IFormattable