From 0e0da0aa04e8a16598ce0ebb449c61322aff5af2 Mon Sep 17 00:00:00 2001 From: Andrea Zagli Date: Sat, 9 Jul 2011 12:52:43 +0200 Subject: [PATCH] Aggiunta la funzione Solipa::gdatetime_format. --- src/utils.c | 14 ++++++++++++++ src/utils.h | 1 + 2 files changed, 15 insertions(+) diff --git a/src/utils.c b/src/utils.c index df5ce0e..78ee544 100644 --- a/src/utils.c +++ b/src/utils.c @@ -851,6 +851,20 @@ GDateTime return ret; } +gchar +*solipa_gdatetime_format (GDateTime *gdatetime, const gchar *format) +{ + gchar *ret; + + if (gdatetime == NULL) return ""; + + ret = g_date_time_format (gdatetime, format); + + if (ret == NULL) return ""; + + return ret; +} + gdouble solipa_round (gdouble value, guint n_decimals) { diff --git a/src/utils.h b/src/utils.h index 4de2b13..d5baeb4 100644 --- a/src/utils.h +++ b/src/utils.h @@ -65,6 +65,7 @@ const gchar *solipa_tm_to_sql (struct tm *tm_data, const gchar *format); const gchar *solipa_gdatetime_to_sql (GDateTime *gdatetime, const gchar *format); GDateTime *solipa_get_gdatetime_from_string (const gchar *string, const gchar *format); +gchar *solipa_gdatetime_format (GDateTime *gdatetime, const gchar *format); gdouble solipa_round (gdouble value, guint n_decimals); -- 2.49.0