/// <summary>
        /// Convert to a postgresql time.
        /// </summary>

        internal static String ToTime(NpgsqlNativeTypeInfo TypeInfo, Object NativeData, Boolean ForExtendedQuery)
        {
            if (!(NativeData is DateTime))
            {
                return(ExtendedNativeToBackendTypeConverter.ToTime(TypeInfo, NativeData, ForExtendedQuery));
            }
            else
            {
                return(((DateTime)NativeData).ToString("HH:mm:ss.ffffff", DateTimeFormatInfo.InvariantInfo));
            }
        }
Пример #2
0
 /// <summary>
 /// Convert to a postgresql time.
 /// </summary>
 internal static byte[] ToTime(NpgsqlNativeTypeInfo TypeInfo, Object NativeData, Boolean forExtendedQuery, NativeToBackendTypeConverterOptions options, bool arrayElement)
 {
     if (!(NativeData is DateTime))
     {
         return(ExtendedNativeToBackendTypeConverter.ToTime(TypeInfo, NativeData, forExtendedQuery, options, arrayElement));
     }
     else
     {
         return(BackendEncoding.UTF8Encoding.GetBytes(((DateTime)NativeData).ToString("HH:mm:ss.ffffff", DateTimeFormatInfo.InvariantInfo)));
     }
 }