Converts a DateTime into a Byte array containing ASCII encoded text, to be carried in a Byte Sequence Header type.
A Byte array containing the date and time value in the defined format.
This is the conversion as described in OBEX13.pdf Section 2.2.5, regarding the format for the “Time” header. This creates as ASCII string with the date and time formatted in ISO 8601 style as YYYYMMDDTHHDDMMSS, with a final letter Z if the date and time are in UTC. It is not specified there, but we can see from the example in section 9.2.4 that the string should not be null-terminated.
DateTime has three defined ‘kinds’ (DateTimeKind): Unspecified, Utc, and Local. We mark the time as UTC only if the DateTime passed is of ‘kind’ Utc. This of course applies only to framework version 2 and later.
ObexHeaderConverter Class | Brecham.Obex Namespace | DateTimeFromIso8601ByteSeq