Update of /cvsroot/monetdb/sql/src/backends/monet5
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv2198

Modified Files:
        monetdb.mx 
Log Message:
save some calculations, and add "weeks"


U monetdb.mx
Index: monetdb.mx
===================================================================
RCS file: /cvsroot/monetdb/sql/src/backends/monet5/monetdb.mx,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -d -r1.22 -r1.23
--- monetdb.mx  28 Aug 2008 14:05:48 -0000      1.22
+++ monetdb.mx  29 Aug 2008 16:23:31 -0000      1.23
@@ -167,7 +167,15 @@
        time_t p;
        size_t i = 0;
 
-       p = 1 * 60 * 60 * 24;
+       p = 1 * 60 * 60 * 24 * 7;
+       if (t > p) {
+               i += sprintf(buf, "%dw", (int)(t / p));
+               t -= (t / p) * p;
+               if (printlong == 0)
+                       return;
+               buf[i++] = ' ';
+       }
+       p /= 7;
        if (t > p) {
                i += sprintf(buf, "%dd", (int)(t / p));
                t -= (t / p) * p;
@@ -175,7 +183,7 @@
                        return;
                buf[i++] = ' ';
        }
-       p = 1 * 60 * 60;
+       p /= 24;
        if (t > p) {
                i += sprintf(buf + i, "%dh", (int)(t / p));
                t -= (t / p) * p;
@@ -183,7 +191,7 @@
                        return;
                buf[i++] = ' ';
        }
-       p = 1 * 60;
+       p /= 60;
        if (t > p) {
                i += sprintf(buf + i, "%dm", (int)(t / p));
                t -= (t / p) * p;


-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Monetdb-sql-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-sql-checkins

Reply via email to