public static int Decode_Datetime(ref Byte[] apdu, ref BACNET_DATE_TIME value, int pos)
        {
            int len = 0;
            int section_len;

            section_len = Decode_Application_Date(ref apdu, ref value.date, pos + len);
            len        += section_len;
            section_len = Decode_Application_Time(ref apdu, ref value.time, pos + len);
            len        += section_len;

            return(len);
        }
        public static int Encode_Datetime(ref Byte[] apdu, ref BACNET_DATE_TIME value, int pos)
        {
            int len      = 0;
            int apdu_len = 0;

            len       = Encode_Application_Date(ref apdu, ref value.date, apdu_len + pos);
            apdu_len += len;

            len       = Encode_Application_Time(ref apdu, ref value.time, apdu_len + pos);
            apdu_len += len;

            return(apdu_len);
        }
        public static int Encode_Context_Datetime(ref Byte[] apdu, Byte tag_number, ref BACNET_DATE_TIME value, int pos)
        {
            int len      = 0;
            int apdu_len = 0;

            len       = Encode_Opening_Tag(ref apdu, tag_number, pos + apdu_len);
            apdu_len += len;

            len = Encode_Datetime(ref apdu, ref value, pos + apdu_len);

            apdu_len += len;

            len       = Encode_Closing_Tag(ref apdu, tag_number, pos + apdu_len);
            apdu_len += len;

            return(apdu_len);
        }
        public static int Decode_Context_Datetime(ref Byte[] apdu, Byte tag_number, ref BACNET_DATE_TIME value, int pos)
        {
            int apdu_len = 0;
            int len;

            if (Decode_Is_Opening_Tag_Number(ref apdu, tag_number, pos + apdu_len))
            {
                apdu_len++;
            }
            len       = Decode_Datetime(ref apdu, ref value, apdu_len + pos);
            apdu_len += len;
            if (Decode_Is_Closing_Tag_Number(ref apdu, tag_number, pos + apdu_len))
            {
                apdu_len++;
            }

            return(apdu_len);
        }