September 07th 2017 Week 36th Thursday

在快节奏的社会中,保持真实自我至关重要。只有认识自己,才能避免迷失并找到真正属于自己的幸福。引用《绿野仙踪》中的名言,强调心灵的重要性远超智慧。

With the most true of yourself, can you meet the most suitable one.

用最真实的自己,才能遇见最合适的那个人。

You are always in a rush, you are always too exhausted to have a proper and deep converstation with yourself.

That makes you easily get lost in such a rapid and fickle society, in the end, probably you will get nothing in return for your effrots.

 

I shall take the heart, for brains do not make one happy, and happiness is the best thing in the world.

我要心灵,因为脑子不能使人幸福,而幸福是世界上最重要的事情。

From The Wonderful Wizard of OZ.

In Chinese, the series are named as "绿野仙踪".

转载于:https://www.cnblogs.com/dengwenwu/p/7877475.html

/* * fn CMM_RET oal_sys_setTZ(TIME_OBJ *pNewObj, const struct tm *pDstStart, const struct tm *pDstEnd, const char *pTimeZone) * brief Set system timezone environment variable * * param[in] pNewObj - The time obj. * param[in] pDstStart - DaylightSavings start time. * param[in] pDstend - DaylightSavings end time. * param[in] pTimeZone - The local time zone. * * return CMM_RET */ CMM_RET oal_sys_setTZ(DEV2_TIME_OBJ *pNewObj, const struct tm *pDstStart, const struct tm *pDstEnd, const char *pTimeZone) { struct timeval tv; struct timeval *setTv = NULL; struct timezone tz; int tzHour = 0, tzMin = 0; #if (defined(__GLIBC__) && !defined(__UCLIBC__)) const char* mon_names[] = { "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December" }; const char* week_counts[][2] = { {"",">=1"}, /* 1st*/ {"",">=8"}, /* 2nd */ {"",">=15"}, /* 3rd */ {"",">=22"}, /* 4th */ {"last",""} /* last */ }; const char* wday_names[] = { "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" }; int startWeekCount = 0, endWeekCount = 0; char tzInfo[BUFLEN_512] = {0}; char *pTmp = tzInfo; FILE *fp = NULL; if (pNewObj->daylightSavingsUsed) { /* set the week count as the UI wants */ startWeekCount = pNewObj->X_TP_DaylightSavingsStartWeekCount; endWeekCount = pNewObj->X_TP_DaylightSavingsEndWeekCount; pTmp += sprintf(pTmp, "Rule MYR minimum maximum - %s %s%s%s %02d:0:0 1:00 D\n", mon_names[pDstStart->tm_mon], week_counts[startWeekCount-1][0], wday_names[pDstStart->tm_wday], week_counts[startWeekCount-1][1], pDstStart->tm_hour); pTmp += sprintf(pTmp, "Rule MYR minimum maximum - %s %s%s%s %02d:0:0 0 S\n", mon_names[pDstEnd->tm_mon], week_counts[endWeekCount-1][0], wday_names[pDstEnd->tm_wday], week_counts[endWeekCount-1][1], pDstEnd->tm_hour); pTmp += sprintf(pTmp, "Zone localtime %s MYR C%%sT\n", pTimeZone); } else { pTmp += sprintf(pTmp, "Zone localtime %s - CST\n", pTimeZone); } fp = fopen(__GLIBC_TZ_FILE_PATH__, "w+"); if (fp == NULL) { CMM_ERR("Open TZ file error!"); return CMM_ERROR; } if (fwrite(tzInfo, strlen(tzInfo), 1, fp) < 0) { CMM_ERR("Write TZ file error!"); fclose(fp); return CMM_ERROR; } fclose(fp); /* create /var/tmp/localtime */ util_execSystem(__FUNCTION__, "zic -d /var/tmp %s", __GLIBC_TZ_FILE_PATH__); #else int startWeekCount = 0, endWeekCount = 0; char tzInfo[BUFLEN_128] = {0}; char tmpTimeZone[BUFLEN_128] = {0}; char *pTmp = tzInfo; FILE *fp = NULL; /* Get the entire timezone */ cstr_strncpy(tmpTimeZone, pTimeZone, BUFLEN_128); tmpTimeZone[0] ^= 6; /* Change the leading symbol, '+' -> '-' or '-' -> '+' */ pTmp += sprintf(pTmp, "GMT%s", tmpTimeZone); /* DaylightSavings is enable */ if (pNewObj->daylightSavingsUsed) { /* set the week count as the UI wants */ startWeekCount = pNewObj->X_TP_DaylightSavingsStartWeekCount; endWeekCount = pNewObj->X_TP_DaylightSavingsEndWeekCount; /* Get the dst info, like "DST,Mmon.cnt.wday/hh,Mmon.cnt.wday/hh */ pTmp += sprintf(pTmp, "DST,M%d.%d.%d/%d,M%d.%d.%d/%d", \ pDstStart->tm_mon + 1, startWeekCount, pDstStart->tm_wday, pDstStart->tm_hour,\ pDstEnd->tm_mon + 1, endWeekCount, pDstEnd->tm_wday, pDstEnd->tm_hour); } *pTmp++ = '\n'; *pTmp = '\0'; /* Write the tzInfo to the file: /etc/TZ */ fp = fopen(__UCLIBC_TZ_FILE_PATH__, "w+"); if (fp == NULL) { CMM_ERR("Open TZ file error!"); return CMM_ERROR; } if (fwrite(tzInfo, strlen(tzInfo), 1, fp) < 0) { CMM_ERR("Write TZ file error!"); fclose(fp); return CMM_ERROR; } fclose(fp); #endif /* liuyuxuan add for parental control V2 */ memset(&tv, 0, sizeof(struct timeval)); memset(&tz, 0, sizeof(struct timezone)); gettimeofday(&tv, &tz); sscanf(pTimeZone, "%d:%d", &tzHour, &tzMin); if(tzMin > 0 && tzHour < 0) { tzMin = -tzMin; } tz.tz_minuteswest = -(MINUTES * tzHour + tzMin); settimeofday(setTv, &tz); /* liuyuxuan add end */ return CMM_OK; } 是在哪里设定夏令时
10-25
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值