The following commit has been merged in the master branch:
commit ba2a1269c66726fb47fba2812eadfb1f5a4548b5
Author: Michal Čihař <mci...@novell.com>
Date:   Thu Mar 3 11:44:36 2011 +0100

    ODBC formatting of date

diff --git a/smsd/services/sql.c b/smsd/services/sql.c
index c90ca2b..f274107 100644
--- a/smsd/services/sql.c
+++ b/smsd/services/sql.c
@@ -148,6 +148,9 @@ void SMSDSQL_Time2String(struct GSM_SMSDdbobj *db, time_t 
timestamp, char *stati
        struct tm *timestruct;
        if (timestamp == -2) {
                strcpy(static_buff, "0000-00-00 00:00:00");
+       } else if (strcasecmp(db->DriverName, "odbc") == 0) {
+               timestruct = gmtime(&timestamp);
+               strftime(static_buff, size, "{ ts '%Y-%m-%d %H:%M:%S' }", 
timestruct);
        } else if (strcmp(db->DriverName, "pgsql") == 0) {
                timestruct = gmtime(&timestamp);
                strftime(static_buff, size, "%Y-%m-%d %H:%M:%S GMT", 
timestruct);

-- 
Gammu

_______________________________________________
Gammu-svn mailing list
Gammu-svn@lists.cihar.com
https://lists.cihar.com/cgi-bin/mailman/listinfo/gammu-svn

Reply via email to