Brecham.Obex — An OBEX library for the .NET Framework

ObexHeaderConverter.DateTimeFromIso8601ByteSeq Method 

Converts a Byte array containing ASCII encoded text, containing a date/time value formatted in ISO8601 style into a DateTime instance.

[Visual Basic]
Public Shared Function DateTimeFromIso8601ByteSeq( _
   ByVal bytes As Byte() _
) As Date
[C#]
public static DateTime DateTimeFromIso8601ByteSeq(
   byte[] bytes
);

Parameters

bytes
The received Byte array containing the formatted Time string.

Return Value

Remarks

As discussed in the corresponding conversion method DateTimeAsIso8601ByteSeq the date time is formatted in text as YYYYMMDDTHHDDMMSS, with a final letter Z if the date and time are in UTC.

DateTime has three defined ‘kinds’ (DateTimeKind): Unspecified, Utc, and Local. Depending on whether the input is marked as UTC we mark the DateTime returned as Utc, and Local respectively. This of course applies only to framework version 2 and later.

Note, we allow the string to have a final null-termination byte.

See Also

ObexHeaderConverter Class | Brecham.Obex Namespace | DateTimeAsIso8601ByteSeq