Ejemplo n.º 1
0
        /// <summary>
        /// Converts <see cref="NpgsqlTypes.NpgsqlTimeStamp"/> to .NET <see cref="DateTime"/> format.
        /// </summary>
        /// <param name="dt">The datetime to convert from.</param>
        /// <returns>Returns the datetime in <see cref="DateTime"/> format.</returns>
        public static DateTime ToDateTime(this NpgsqlTypes.NpgsqlTimeStamp dt)
        {
            DateTime dtRet = new DateTime(dt.Year, dt.Month, dt.Day, dt.Hours, dt.Minutes, dt.Seconds);

            return(dtRet);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Converts .NET <see cref="DateTime"/> to <see cref="NpgsqlTypes.NpgsqlTimeStamp"/> format.
 /// </summary>
 /// <param name="datetime">The .NET datetime to convert from.</param>
 /// <returns>Returns the datetime in <see cref="NpgsqlTypes.NpgsqlTimeStamp"/> format.</returns>
 public static NpgsqlTypes.NpgsqlTimeStamp ToPostgreTimeStamp(this DateTime datetime)
 {
     NpgsqlTypes.NpgsqlTimeStamp t =
         new NpgsqlTypes.NpgsqlTimeStamp(datetime.Year, datetime.Month, datetime.Day, datetime.Hour, datetime.Minute, datetime.Second);
     return(t);
 }