[mw-devel] MW3 r1333 - trunk/src

psycodom at sucs.org psycodom at sucs.org
Sat Apr 27 12:34:43 BST 2013


Author: psycodom
Date: 2013-04-27 12:34:42 +0100 (Sat, 27 Apr 2013)
New Revision: 1333

Modified:
   trunk/src/uri.c
Log:
Uses 'localtime' for the added datetime in the .uri command so in BST the time printed matches up with the time displayed when the user first typed the uri.


Modified: trunk/src/uri.c
===================================================================
--- trunk/src/uri.c	2013-02-13 18:09:35 UTC (rev 1332)
+++ trunk/src/uri.c	2013-04-27 11:34:42 UTC (rev 1333)
@@ -131,9 +131,9 @@
 	char flagstr[1024]="";
 	
 	if(username == NULL) {
-		query = sqlite3_mprintf("SELECT id,added,user,url,title,flags FROM mwuri ORDER BY id DESC LIMIT %d", number);
+		query = sqlite3_mprintf("SELECT id,datetime(added, 'localtime'),user,url,title,flags FROM mwuri ORDER BY id DESC LIMIT %d", number);
 	} else {
-		query = sqlite3_mprintf("SELECT id,added,user,url,title,flags FROM mwuri WHERE user=%Q ORDER BY id DESC LIMIT %d", username, number);
+		query = sqlite3_mprintf("SELECT id,datetime(added, 'localtime'),user,url,title,flags FROM mwuri WHERE user=%Q ORDER BY id DESC LIMIT %d", username, number);
 	}
 	res = db_query(MWURI_DB, query, 1);	
 	fflush(stdout);
@@ -470,7 +470,7 @@
 	
 	if((id = uri_get_id(argv[1], wiz)) > 0 )
 	{
-		query = sqlite3_mprintf("SELECT user,url,flags,added FROM mwuri WHERE id=%d", id);
+		query = sqlite3_mprintf("SELECT user,url,flags,datetime(added, 'localtime') FROM mwuri WHERE id=%d", id);
 		res = db_query(MWURI_DB, query, 1);	
 		if(res)
 		{




More information about the mw-devel mailing list