[Gnucash-changes] The old gnc_iso8601_to_timespec_local() was actually returning the GMT

Linas Vepstas linas at cvs.gnucash.org
Sun May 2 16:50:07 EDT 2004


Log Message:
-----------
The old gnc_iso8601_to_timespec_local() was actually returning the
GMT time.  The new gnc_iso8601_to_timespec_gmt() is going to return
the GMT time.  Thus, the net result of this change will be a no-op.

Modified Files:
--------------
    gnucash/src/backend/postgres:
        PostgresBackend.c
        checkpoint.c
        events.c
        kvp-sql.c
        price.c
        txn.c
        txnmass.c

Revision Data
-------------
Index: txn.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/txn.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -Lsrc/backend/postgres/txn.c -Lsrc/backend/postgres/txn.c -u -r1.28 -r1.29
--- src/backend/postgres/txn.c
+++ src/backend/postgres/txn.c
@@ -480,7 +480,7 @@
             /* next, restore all split data */
             xaccSplitSetMemo(s, DB_GET_VAL("memo",j));
             xaccSplitSetAction(s, DB_GET_VAL("action",j));
-            ts = gnc_iso8601_to_timespec_local
+            ts = gnc_iso8601_to_timespec_gmt
               (DB_GET_VAL("date_reconciled",j));
             xaccSplitSetDateReconciledTS (s, &ts);
 
@@ -774,9 +774,9 @@
        if (do_set_guid) xaccTransSetGUID (trans, trans_guid);
        xaccTransSetNum (trans, DB_GET_VAL("num",j));
        xaccTransSetDescription (trans, DB_GET_VAL("description",j));
-       ts = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_posted",j));
+       ts = gnc_iso8601_to_timespec_gmt (DB_GET_VAL("date_posted",j));
        xaccTransSetDatePostedTS (trans, &ts);
-       ts = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_entered",j));
+       ts = gnc_iso8601_to_timespec_gmt (DB_GET_VAL("date_entered",j));
        xaccTransSetDateEnteredTS (trans, &ts);
        xaccTransSetVersion (trans, atoi(DB_GET_VAL("version",j)));
        xaccTransSetCurrency (trans, currency);
Index: price.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/price.c,v
retrieving revision 1.21
retrieving revision 1.22
diff -Lsrc/backend/postgres/price.c -Lsrc/backend/postgres/price.c -u -r1.21 -r1.22
--- src/backend/postgres/price.c
+++ src/backend/postgres/price.c
@@ -309,7 +309,7 @@
    modity = gnc_string_to_commodity (DB_GET_VAL("currency",j), book);
    gnc_price_set_currency (pr, modity);
 
-   ts = gnc_iso8601_to_timespec_local (DB_GET_VAL("time",j));
+   ts = gnc_iso8601_to_timespec_gmt (DB_GET_VAL("time",j));
    gnc_price_set_time (pr, ts);
 
    gnc_price_set_source (pr, DB_GET_VAL("source",j));
Index: txnmass.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/txnmass.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -Lsrc/backend/postgres/txnmass.c -Lsrc/backend/postgres/txnmass.c -u -r1.17 -r1.18
--- src/backend/postgres/txnmass.c
+++ src/backend/postgres/txnmass.c
@@ -98,9 +98,9 @@
 
    xaccTransSetNum (trans, DB_GET_VAL("num",j));
    xaccTransSetDescription (trans, DB_GET_VAL("description",j));
-   ts = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_posted",j));
+   ts = gnc_iso8601_to_timespec_gmt (DB_GET_VAL("date_posted",j));
    xaccTransSetDatePostedTS (trans, &ts);
-   ts = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_entered",j));
+   ts = gnc_iso8601_to_timespec_gmt (DB_GET_VAL("date_entered",j));
    xaccTransSetDateEnteredTS (trans, &ts);
    xaccTransSetVersion (trans, atoi(DB_GET_VAL("version",j)));
    trans->idata = atoi (DB_GET_VAL("iguid",j));
@@ -151,7 +151,7 @@
    /* next, restore all split data */
    xaccSplitSetMemo(s, DB_GET_VAL("memo",j));
    xaccSplitSetAction(s, DB_GET_VAL("action",j));
-   ts = gnc_iso8601_to_timespec_local
+   ts = gnc_iso8601_to_timespec_gmt
      (DB_GET_VAL("date_reconciled",j));
    xaccSplitSetDateReconciledTS (s, &ts);
 
Index: checkpoint.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/checkpoint.c,v
retrieving revision 1.12
retrieving revision 1.13
diff -Lsrc/backend/postgres/checkpoint.c -Lsrc/backend/postgres/checkpoint.c -u -r1.12 -r1.13
--- src/backend/postgres/checkpoint.c
+++ src/backend/postgres/checkpoint.c
@@ -115,7 +115,7 @@
    /* malloc a new checkpoint, set it to the dawn of unix time ... */
    bp = g_chunk_new0 (Checkpoint, chunk);
    checkpoints = g_list_prepend (checkpoints, bp);
-   this_ts = gnc_iso8601_to_timespec_local (CK_EARLIEST_DATE);
+   this_ts = gnc_iso8601_to_timespec_gmt (CK_EARLIEST_DATE);
    bp->date_start = this_ts;
    bp->account_guid = acct_guid;
    bp->commodity = commodity_name;
@@ -153,11 +153,11 @@
                 goto done; 
             }
 
-            if (0 == i) this_ts = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_posted",0));
+            if (0 == i) this_ts = gnc_iso8601_to_timespec_gmt (DB_GET_VAL("date_posted",0));
             if (2 == jrows) {
-               next_ts = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_posted",1));
+               next_ts = gnc_iso8601_to_timespec_gmt (DB_GET_VAL("date_posted",1));
             } else if (1 == i) {
-               next_ts = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_posted",0));
+               next_ts = gnc_iso8601_to_timespec_gmt (DB_GET_VAL("date_posted",0));
             } 
             PQclear (result);
             i++;
@@ -192,7 +192,7 @@
 done:
 
    /* set the timestamp on the final checkpoint into the distant future */
-   this_ts = gnc_iso8601_to_timespec_local (CK_LAST_DATE);
+   this_ts = gnc_iso8601_to_timespec_gmt (CK_LAST_DATE);
    bp->date_end = this_ts;
 
    /* now store the checkpoints */
@@ -320,7 +320,7 @@
 get_checkpoint_date_cb (PGBackend *be, PGresult *result, int j, gpointer data)
 {
    Checkpoint *chk = (Checkpoint *) data;
-   chk->date_start = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_start", j));
+   chk->date_start = gnc_iso8601_to_timespec_gmt (DB_GET_VAL("date_start", j));
    return data;
 }
 
@@ -371,7 +371,7 @@
    SEND_QUERY (be,be->buff, );
 
    /* provide default value, in case there are no checkpoints */
-   chk->date_start = gnc_iso8601_to_timespec_local (CK_EARLIEST_DATE);
+   chk->date_start = gnc_iso8601_to_timespec_gmt (CK_EARLIEST_DATE);
    pgendGetResults (be, get_checkpoint_date_cb, chk);
 
    LEAVE("be=%p", be);
Index: kvp-sql.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/kvp-sql.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -Lsrc/backend/postgres/kvp-sql.c -Lsrc/backend/postgres/kvp-sql.c -u -r1.14 -r1.15
--- src/backend/postgres/kvp-sql.c
+++ src/backend/postgres/kvp-sql.c
@@ -471,7 +471,7 @@
 {
    Timespec ts;
    KVP_HANDLER_SETUP;
-   ts = gnc_iso8601_to_timespec_local (DB_GET_VAL ("data", j));
+   ts = gnc_iso8601_to_timespec_gmt (DB_GET_VAL ("data", j));
    kv = kvp_value_new_timespec (ts);
    KVP_HANDLER_TAKEDOWN;
 }
Index: PostgresBackend.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/PostgresBackend.c,v
retrieving revision 1.52
retrieving revision 1.53
diff -Lsrc/backend/postgres/PostgresBackend.c -Lsrc/backend/postgres/PostgresBackend.c -u -r1.52 -r1.53
--- src/backend/postgres/PostgresBackend.c
+++ src/backend/postgres/PostgresBackend.c
@@ -476,9 +476,9 @@
 
    xaccTransSetNum (trans, DB_GET_VAL("num",j));
    xaccTransSetDescription (trans, DB_GET_VAL("description",j));
-   ts = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_posted",j));
+   ts = gnc_iso8601_to_timespec_gmt (DB_GET_VAL("date_posted",j));
    xaccTransSetDatePostedTS (trans, &ts);
-   ts = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_entered",j));
+   ts = gnc_iso8601_to_timespec_gmt (DB_GET_VAL("date_entered",j));
    xaccTransSetDateEnteredTS (trans, &ts);
    xaccTransSetVersion (trans, atoi(DB_GET_VAL("version",j)));
    trans->idata = atoi(DB_GET_VAL("iguid",j));
@@ -919,7 +919,7 @@
    if ((MODE_SINGLE_FILE != be->session_mode) &&
        (MODE_SINGLE_UPDATE != be->session_mode))
    {
-      Timespec ts = gnc_iso8601_to_timespec_local (CK_BEFORE_LAST_DATE);
+      Timespec ts = gnc_iso8601_to_timespec_gmt (CK_BEFORE_LAST_DATE);
       pgendGroupGetAllBalances (be, grp, ts);
    } 
    else
@@ -1493,7 +1493,7 @@
 static void
 pgend_book_load_poll (QofBackend *bend, QofBook *book)
 {
-   Timespec ts = gnc_iso8601_to_timespec_local (CK_BEFORE_LAST_DATE);
+   Timespec ts = gnc_iso8601_to_timespec_gmt (CK_BEFORE_LAST_DATE);
    AccountGroup *grp;
    PGBackend *be = (PGBackend *)bend;
 
Index: events.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/backend/postgres/events.c,v
retrieving revision 1.18
retrieving revision 1.19
diff -Lsrc/backend/postgres/events.c -Lsrc/backend/postgres/events.c -u -r1.18 -r1.19
--- src/backend/postgres/events.c
+++ src/backend/postgres/events.c
@@ -187,7 +187,7 @@
    }
 
    string_to_guid (guid_str, &guid);
-   ts = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_changed",j));
+   ts = gnc_iso8601_to_timespec_gmt (DB_GET_VAL("date_changed",j));
 
    /* Compress multiple events for the same object.  In other
     * words, keep only the last event for this object.
@@ -437,7 +437,7 @@
    Timespec latest;
 
    /* get event timestamp */
-   latest = gnc_iso8601_to_timespec_local (DB_GET_VAL("date_changed",j));
+   latest = gnc_iso8601_to_timespec_gmt (DB_GET_VAL("date_changed",j));
    latest.tv_sec ++;  /* ignore old, pre-logon events */
 
    be->last_account = latest;


More information about the Gnucash-changes mailing list