Description
Provides helper methods for a date.
Object Model
Public Methods
Add |
Adds the value in the given
unit and returns a new date interface. |
Format |
Returns the value of the
date given the unit. |
SetDate |
Sets this date with the
given date value and unit type. |
Span |
Subtracts the value from
the IAgDate interface and returns an IAgQuantity. |
Subtract |
Subtracts the value in the
given unit and returns a new date interface. |
Public Properties
OLEDate |
The current time in OLE
DATE Format. |
SecIntoDay |
Contains values between 0.0
and 86400 with the exception of when the date is inside a leap
second in which case the SecIntoDay can become as large as
86401.0 |
SecIntoDayUTC |
Contains values between 0.0
and 86400 with the exception of when the date is inside a leap
second in which case the SecIntoDay can become as large as
86401.0 |
WholeDays |
The Julian Day Number of
the date of interest. |
WholeDaysUTC |
The UTC Day Number of the
date of interest. |
Example
Calculate date
subtraction (with IAgDate)
[C#] |
Copy Code
|
IAgDate nowDate = root.ConversionUtility.NewDate("DD/MM/YYYY", DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss.fff"));
IAgDate newDate = nowDate.Subtract("day", 52.0);
IAgQuantity span = newDate.Span(nowDate);
span.ConvertToUnit("min");
Console.WriteLine("Date(now) in UTCG is: {0}", nowDate.Format("UTCG"));
Console.WriteLine("Date(52 days before now) in UTCG is: {0}", newDate.Format("UTCG"));
Console.WriteLine("The difference between now and 52 days ago is {0} minutes!", span.Value);
|
|
Calculate date
addition (with IAgDate)
[C#] |
Copy Code
|
IAgDate nowDate = root.ConversionUtility.NewDate("DD/MM/YYYY", DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss.fff"));
IAgDate newDate = nowDate.Add("day", 52.0);
IAgQuantity span = newDate.Span(nowDate);
span.ConvertToUnit("min");
Console.WriteLine("Date(now) in UTCG is: {0}", nowDate.Format("UTCG"));
Console.WriteLine("Date(52 days from now) in UTCG is: {0}", newDate.Format("UTCG"));
Console.WriteLine("The difference between now and 52 days to come is {0} minutes!", span.Value);
|
|
Calculate date
subtraction (with IAgDate)
[Visual Basic .NET] |
Copy Code
|
#If Not CSToJava Then
Dim nowDate As IAgDate =
root.ConversionUtility.NewDate("DD/MM/YYYY", DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss.fff"))
#Else
#End If
Dim newDate As IAgDate = nowDate.Subtract("day", 52)
Dim span As IAgQuantity = newDate.Span(nowDate)
span.ConvertToUnit("min")
Console.WriteLine("Date(now) in UTCG is:
{0}", nowDate.Format("UTCG"))
Console.WriteLine("Date(52 days before now) in
UTCG is: {0}", newDate.Format("UTCG"))
Console.WriteLine("The difference between now
and 52 days ago is {0} minutes!", span.Value)
|
|
Calculate date
addition (with IAgDate)
[Visual Basic .NET] |
Copy Code
|
#If Not CSToJava Then
Dim nowDate As IAgDate =
root.ConversionUtility.NewDate("DD/MM/YYYY", DateTime.Now.ToString("dd/MM/yyyy HH:mm:ss.fff"))
#Else
#End If
Dim newDate As IAgDate = nowDate.Add("day", 52)
Dim span As IAgQuantity = newDate.Span(nowDate)
span.ConvertToUnit("min")
Console.WriteLine("Date(now) in UTCG is:
{0}", nowDate.Format("UTCG"))
Console.WriteLine("Date(52 days from now) in
UTCG is: {0}", newDate.Format("UTCG"))
Console.WriteLine("The difference between now
and 52 days to come is {0} minutes!", span.Value)
|
|