linux ÏÂc++¼°mysql¶Ôʱ¼ä´¦ÀíµÄ³£Óü¼ÇÉ
mysql ½Øȡijһ¸öʱ¼ä(datetimeÀàÐÍ)µÄÈÕÆÚ£º
·½·¨1£ºselect date(row_name) from table_name where row = row1;
·½·¨2£ºselect left(row_name, 10) from table_name where row = row1;
·½·¨3£ºselect cast(row_name as char[10]) from table_name where row = row1;
È¡µÃij¸öÈÕÆÚµÄtime_tÊýÖµ£ºselect unix_timestamp(date(row_name)) from table_name where row = row1;
ÒÔtime_tΪ²ÎÊýÈ¡µÃij¸öʱ¼ä
time_t ÊÇ'1970-01-01 00:00:00'ÒÔÀ´µÄÃëÊý
select '1970-01-01 00:00:00'+ INTERVAL time_t_num SECOND ;
È¡µÃµ±Ç°ÈÕÆÚ£ºselect curdate();
È¡µÃµ±Ç°Ê±¼ä£ºselect now();
½«ÈÕÆÚת»¯Îª¶ÌÈÕÆÚ¸ñʽ
SELECT REPLACE(date(row_name), '-0', '-');
linuxÏÂc++³£ÓÃʱ¼ä´¦Àíº¯Êý
clock()ÓÃÀ´³ÌÐò¼Æʱ
ÀýÈ磺 ÒÔÏÂÕª×Ô
#include “stdio.h”
#include “stdlib.h”
#include “time.h”
int main( void )
{
long i = 10000000L;
clock_t start, finish;
double duration;
/* ²âÁ¿Ò»¸öʼþ³ÖÐøµÄʱ¼ä*/
printf( "Time to do %ld empty loops is ", i );
start = clock();
while( i-- ) ;
finish = clock();
duration = (double)(finish - start) / CLOCKS_PER_SEC;
printf( "%f seconds\n", duration );
system("pause");
}
ʾÀý³ö´¦£ºDIY²¿Âä(http://www.diybl.com/course/3_program/vc/vc_js/20090307/159296.html)
time_tÀàÐÍ
time_t t = time(NULL);
time_tת³ÉtmÀàÐÍ
struct tm* t_tm = localtime(time(NULL));
time_tת³É×Ö·û´®¸ñʽ
struct tm* tm_ago = localtime(&t);
sprintf(date_days_ago, "%04d-%02d-%02d", 1900+tm_ago->tm_year,
tm_ago->tm_mon+1, tm_ago->tm_mday);
time_t t_now = time(NULL); //seconds since 1970-01-01
struct
Ïà¹ØÎĵµ£º
Òª½¨Á¢Ò»¸ö°²È«Linux·þÎñÆ÷¾ÍÊ×ÏÈÒªÁ˽âLinux»·¾³ÏºÍÍøÂç·þÎñÏà¹ØµÄÅäÖÃÎļþµÄº¬Òå¼°ÈçºÎ½øÐа²È«µÄÅäÖá£ÔÚLinuxϵͳÖУ¬TCP/IPÍø
ÂçÊÇͨ¹ýÈô¸É¸öÎı¾Îļþ½øÐÐÅäÖõģ¬Ò²ÐíÄãÐèÒª±à¼ÕâЩÎļþÀ´Íê³ÉÁªÍø¹¤×÷£¬µ«ÊÇÕâЩÅäÖÃÎļþ´ó¶¼¿ÉÒÔͨ¹ýÅäÖÃÃüÁîlinuxconf(ÆäÖÐÍøÂ粿·ÖµÄÅä
ÖÿÉÒÔͨ¹ýn ......
Ò»¡¢°²×°ÄÚºËÄ£¿é:
Ò»°ã²½Ö裺
(1) ÔÚ/usr/src/linux/ÏÂÔËÐÐmake menuconfig°ÑÐèÒª±àÒë³ÉÄ£¿éµÄÏî´òÉÏ(M)£¬±£´æ²¢Í˳ö¡£
(2) ÔËÐÐmake modules£¬ÕâÒ»²½½«ÔÚ/usr/src/linux/ÏÂÉú³É*.o»ò*.koÎļþ¡£
(3) ÔËÐÐmake modeules_installÀ´°²×°,Õâ²½»á°ÑÉú³ÉµÄ.o»òkoÎļþ¿½±´µ½/lib/modules/`uname -r`/Ï¡£
Èç¹ûÄãÖ»Òª±à ......
aMuleÊÇÒ»¸ö¿ªÔ´Ãâ·ÑµÄP2PÎļþ¹²ÏíÈí¼þ£¬×ñÑGNUͨÓù«¹²Ðí¿ÉÖ¤ÐÒé·¢²¼¡£ÀàËÆÓÚeMule¡£»ùÓÚxMuleºÍlMule¡£¿ÉÓ¦ÓÃ
eDonkey(µç¿)ÍøÂ磬Ҳ֧³ÖKADÍøÂç¡£¿ÉÔÚ°üÀ¨Windows¡¢Linux¡¢MacOSX¡¢*BSDÒÔ¼°SolarisµÄ¶àÖÖ²Ù×÷ϵͳÏÂÔËÐС£
aMuleÒâ¼´£º"the all-platform eMule-like P2P client" ......
select id from message where author_id in (select followed_id from Relation where follower_id=1) order by id desc ºÍ ·Ö±ðÖ´ÐÐ $userlist = select followed_id from Relation where follower_id=1 ÔÙ select id from message where author_id in ($userlist) order by id desc ¾¹È»ÓÐÁ½¸öÊýÁ ......