Description
Converts the specified dates from a given unit to another unit.
Syntax
[Visual Basic .NET] |
---|
Public Function ConvertDateArray( _
ByVal FromUnit As String, _
ByVal ToUnit As String, _
ByVal FromValues As System.Array _
) As System.Array
|
[Managed C++] |
---|
public: System::Array ConvertDateArray(
String __gc ^ FromUnit,
String __gc ^ ToUnit,
System::Array ^ FromValues
);
|
Parameters
See Also
Example
Convert multiple dates of the same format to another format
[C#] |
---|
IAgConversionUtility converter = root.ConversionUtility;
// In batches
// ConvertDateArray expects a one dimensional array of dates
// An array of UTCG dates
Array tempDates = new object[]
{
"1 Jan 2012 12:00:00.000", "1 Jan 2012 14:00:00.000"
};
// Convert UTCG array to EpSec
// ConvertDateArray returns a one dimensional array of converted dates
Array converted = converter.ConvertDateArray("UTCG", "Epsec", ref tempDates);
// Print results
for (int i = 0; i < converted.Length; i++)
{
Console.WriteLine("Date: {0}", converted.GetValue(i));
}
|
|
Convert multiple dates of the same format to another format
[Visual Basic .NET] |
---|
Dim converter As IAgConversionUtility = root.ConversionUtility
' In batches
' ConvertDateArray expects a one dimensional array of dates
' An array of UTCG dates
Dim tempDates As Array = New Object() {"1 Jan 2012 12:00:00.000", "1 Jan 2012 14:00:00.000"}
' Convert UTCG array to EpSec
' ConvertDateArray returns a one dimensional array of converted dates
Dim converted As Array = converter.ConvertDateArray("UTCG", "Epsec", tempDates)
' Print results
Dim i As Integer = 0
While i < converted.Length
Console.WriteLine("Date: {0}", converted.GetValue(i))
System.Math.Max(System.Threading.Interlocked.Increment(i),i - 1)
End While
|
|