[libgda: 2/3] New gda_value_new_date_time method was added



commit f4c8f147cde0ad84d1075f39bbedac8ac5d6887a
Author: Pavlo Solntsev <p sun fun gmail com>
Date:   Fri Aug 31 14:07:57 2018 -0500

    New gda_value_new_date_time method was added

 libgda/gda-value.c | 27 +++++++++++++++++++++++++--
 1 file changed, 25 insertions(+), 2 deletions(-)
---
diff --git a/libgda/gda-value.c b/libgda/gda-value.c
index 1c3be43c3..017d3b7d7 100644
--- a/libgda/gda-value.c
+++ b/libgda/gda-value.c
@@ -1948,7 +1948,31 @@ compute_tz_offset (struct tm *gmttm, struct tm *loctm)
 }
 
 /**
- * gda_value_new_date_time_from_timet:
+ * gda_value_new_date_time:
+ *
+ * Makes a new #GValue of type #G_TYPE_DATE_TIME 
+ *
+ * Returns: (transfer full): the newly created #GValue, or %NULL in case of error
+ *
+ * Free-function: gda_value_free
+ */
+GValue *
+gda_value_new_date_time (GDateTime *dt)
+{
+  if (!dt)
+    return NULL;
+
+  GValue *value;
+
+  value = g_new0 (GValue, 1);
+  g_value_init (value, G_TYPE_DATE_TIME);
+  g_value_set_boxed (value, dt);
+
+       return value;
+}
+
+/**
+ * gda_value_new_date_time:
  * @val: value to set for the new #GValue.
  *
  * Makes a new #GValue of type #G_TYPE_DATE_TIME with value @val
@@ -1978,7 +2002,6 @@ gda_value_new_date_time_from_timet (time_t val)
 
        return value;
 }
-
 /**
  * gda_value_new_time_from_timet:
  * @val: value to set for the new #GValue.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]