STK UtilSend comments on this topic.
ConvertDateArray Method (IAgConversionUtility)
See Also
FromUnit
ToUnit
FromValues
Windows





Windows & Linux

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
[C#]
public System.Array ConvertDateArray(
    string FromUnit,
    string ToUnit,
    System.Array FromValues
);
[Managed C++]
public: System::Array ConvertDateArray(
    String __gc ^ FromUnit,
    String __gc ^ ToUnit,
    System::Array ^ FromValues
);
[Unmanaged C++]
public: HRESULT ConvertDateArray(
    BSTR FromUnit,
    BSTR ToUnit,
    SAFEARRAY * * FromValues,
    SAFEARRAY * * ppConvertedDateValues
);
[Java]
public AgSafeArray convertDateArray(
    String FromUnit,
    String ToUnit,
    AgSafeArray FromValues
);
[Python - STK API ]
def ConvertDateArray(self, FromUnit:str, ToUnit:str, FromValues:list) -> list:

Parameters

FromUnit
ToUnit
FromValues

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
© 2024 Analytical Graphics, Inc. All Rights Reserved.