날짜 파싱 문의

오케스트레이터 asset에 설정된 날짜(텍스트형식)를 가져와서 datetime으로 파싱이 안되는데,
해결 방법이 있을까요 ?

isParseSuccessful(부울) = DateTime.TryParseExact(assetLastDate, “yyyy-MM-ddTHH:mm:ssZ”, System.Globalization.CultureInfo.InvariantCulture, System.Globalization.DateTimeStyles.None, out_lastDate)

out_lastDate 값을 확인해보면 01/01/0001 00:00:00 초기값으로 출력됩니다.

해결방법이 있을까요 ?

HI,

Did you use Assign activity? If so, it doesn’t support ref and out type argument.
Can you try InvokeMethod or InvokeCode as the following?

Sample
Sample20240424-3 (2).zip (2.7 KB)

Regards,

1 Like

Hi @byoung80

Please try the below code once:

Dim assetLastDate As String = "your_date_string_here"
Dim out_lastDate As DateTime

Dim isParseSuccessful As Boolean = DateTime.TryParseExact(assetLastDate, "yyyy-MM-dd'T'HH:mm:ss'Z'", CultureInfo.InvariantCulture, DateTimeStyles.None, out_lastDate)

If isParseSuccessful Then
    ' Parsing successful, use out_lastDate
    Console.WriteLine("Parsed Date: " & out_lastDate.ToString())
Else
    ' Parsing failed, handle error
    Console.WriteLine("Failed to parse date.")
End If

Here, you will use special characters like ‘T’ and ‘Z’ which are properly escaped in your string format.

Hope this helps,
Best Regards.

1 Like