c ÓïÑÔ»ñȡϵͳʱ¼äºÍÊÀ½ç¸÷ʱÇøʱ¼ä
The meaning of each is:
MemberMeaningRange
tm_sec
seconds after the minute
0-61*
tm_min
minutes after the hour
0-59
tm_hour
hours since midnight
0-23
tm_mday
day of the month
1-31
tm_mon
months since January
0-11
tm_year
years since 1900
tm_wday
days since Sunday
0-6
tm_yday
days since January 1
0-365
tm_isdst
Daylight Saving Time flag
ÏÂÃæ³ÌÐò¼ÆËãÃÀ¹ú·ï»Ë³Ç (-7)£¬Öйú±±¾©(+8)£¬ºÍ±ùµº(0)ʱ¼ä£º
#include <stdio.h>
#include <time.h>
struct {
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
}tm;
void show(struct tm * timeinfo,int j)
{
int day,hour;
if(j>0)
{
if((j+timeinfo->tm_hour)/24==1)
day=timeinfo->tm_mday+1;
else
day=timeinfo->tm_mday;
hour=(j+timeinfo->tm_hour)%24;
}
if(j==0)
{
day=timeinfo->tm_mday;
hour=(j+timeinfo->tm_hour)%24;
}
if(j<0)
{
if((j+timeinfo->tm_hour)/24<0)
day=timeinfo->tm_mday-1;
else
day=timeinfo->tm_mday;
hour=(j+timeinfo->tm_hour)%24;
}
printf ( "%4d-%02d-%02d %02d:%02d:%02d\n",1900+timeinfo->tm_year, 1+timeinfo->tm_mon,
day,hour,timeinfo->tm_min,timeinfo->tm_sec);
}
void main ()
{
time_t timer;
struct tm * timeinfo,*ptm;
time ( &timer );//Pointer to an object of type time_t, where the time value is stored.
timeinfo = localtime ( &timer);//·µ»Øµ±µØʱÇøʱ¼ä
ptm = gmtime ( &timer );//·µ»Ø¸ñÁÖÖÆʱÇøʱ¼ä
printf("°´¸ñʽÏÔʾ±ùµºÊ±¼ä\n");
show(ptm,0);
printf("°´¸ñʽÏÔʾÃÀ¹ú·ï»Ë³Çʱ¼ä\n");
show(ptm,-7);
printf("°´¸ñʽÏÔʾÖйú±±¾©Ê±¼ä\n");
show(ptm,8);
}
°´¸ñʽÏÔʾ±ùµºÊ±¼ä
2009-09-24 19:26:30
°´¸ñʽÏÔʾÃÀ¹ú·ï»Ë³Çʱ¼ä
2009-09-24 12:26:30
°´¸ñʽÏÔʾÖйú±±¾©Ê±¼ä
2009-09-25 03:26:30
Ïà¹ØÎĵµ£º
˵Ã÷: ÔÚ±àÒëÏò¸ÃÇëÇóÌṩ·þÎñËùÐè×ÊÔ´µÄ¹ý³ÌÖгöÏÖ´íÎó¡£Çë¼ì²éÏÂÁÐÌض¨´íÎóÏêϸÐÅÏ¢²¢Êʵ±µØÐÞ¸ÄÔ´´úÂë¡£
±àÒëÆ÷´íÎóÐÅÏ¢: CS0016: δÄÜдÈëÊä³öÎļþ“c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\5bad199f\ab65559a\App_Web_index.aspx.cdcab7d2.anxmasko.dll”--“ ......
The C# classes that you design will be used by code that you write and possibly by code that
other people write. Your C# classes may be used by a VB.NET application or from within an
ASP.NET page. Moreover, your classes may very well be used alongside other classes
designed by other .NET develope ......
C++Àà¿â½éÉÜ
ÔÙ´ÎÌåÏÖÁËC++±£³ÖºËÐÄÓïÑÔµÄЧÂÊͬʱ´óÁ¦·¢Õ¹Ó¦ÓÿâµÄ·¢Õ¹Ç÷ÊÆ!!ÔÚC++ÖУ¬¿âµÄµØλÊǷdz£¸ßµÄ¡£C++Ö®¸¸ Bjarne
StroustrupÏÈÉú¶à´Î±íʾÁËÉè¼Æ¿âÀ´À©³ä¹¦ÄÜÒªºÃ¹ýÉè¼Æ¸ü¶àµÄÓï·¨µÄÑÔÂÛ¡£ÏÖʵÖУ¬C++µÄ¿âÃÅÀà·±¶à£¬½â¾öµÄÎÊÌâÒ²ÊǼ«Æä¹ã·º£¬¿â´ÓÇáÁ¿¼¶µ½ÖØ
Á¿¼¶µÄ¶¼Ó ......
const£¬c\c++Öзdz£³£ÓõĹؼü×Ö¡£
Ê×ÏÈÎÒÃÇ¿´¿´constÓÐÄÇЩÐÞÊη½·¨¡£
×îÇ°ÃæÎÒÃÇÀ´¿´Ò»¸öÎÊÌâ¡£
char *p = "123";
¿ÉÄÜÓеÄÈ˲»ÖªµÀ£¬ÕâÀïµÄÕâ¸ö"123"ÊÇ´æ´¢ÔÚ³£Á¿ÇøµÄ£¬²»ÈÝÐíÐ޸ĵġ£
Ò²¾ÍÊÇ˵ËüÊǸöconstÀàÐ͵ġ£
±ê×¼µÄд·¨Ó¦¸ÃÊÇ
char const *p = "123";
ÖÁÓÚΪʲô±àÒëÆ÷ÈÝÐíÉÏÃæµÄÄǸö²»±ê×¼µÄд·¨£¬¿ÉÄ ......
Ôø¾Åöµ½¹ýÈÃÄãÃԻ󲻽⡢ÀàËÆÓÚint * (* (*fp1) (int) ) [10];ÕâÑùµÄ±äÁ¿ÉùÃ÷Âð£¿
±¾ÎĽ«ÓÉÒ×µ½ÄÑ£¬Ò»²½Ò»²½½Ì»áÄãÈçºÎÀí½âÕâÖÖ¸´ÔÓµÄC/C++ÉùÃ÷¡£
ÎÒÃǽ«´ÓÿÌ춼ÄÜÅöµ½µÄ½Ï¼òµ¥µÄÉùÃ÷ÈëÊÖ£¬È»ºóÖð²½¼ÓÈëconstÐÞÊηûºÍtypedef£¬»¹Óк¯ÊýÖ¸Õ룬×îºó½éÉÜÒ»¸öÄܹ»ÈÃÄã׼ȷµØÀí½âÈκÎC/C++ÉùÃ÷µÄ“ÓÒ×ó·¨Ôò&rdquo ......