VirtualBox

儲存庫 vbox 的更動 38730


忽略:
時間撮記:
2011-9-13 下午12:57:58 (13 年 以前)
作者:
vboxsync
訊息:

rtS3DateHeader: How to generate a date field using IPRT (disabled).

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/VBox/Runtime/common/misc/s3.cpp

    r38285 r38730  
    126126{
    127127    /* Date header entry */
     128#if 0  /** @todo r=bird: Use RTTimeNow(), RTTimeExplode() and RTStrPrintf? */
     129    RTTIMESPEC TimeSpec;
     130    RTTIME Time;
     131    RTTimeExplode(&Time, RTTimeNow(&TimeSpec));
     132
     133    static const char s_apszDayNms[7][4] = { "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun" };
     134    static const char s_apszMonthNms[1+12][4] =
     135    { "???", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
     136    char *pszDate;
     137    RTStrAPrintf(&pszDate, "Date: %s, %02u %s %04d %02u:%02u:%02u UTC",
     138                 s_apszDayNms[Time.u8WeekDay],
     139                 Time.u8MonthDay,
     140                 s_apszMonthNms[Time.u8Month],
     141                 Time.i32Year,
     142                 Time.u8Hour,
     143                 Time.u8Minute,
     144                 Time.u8Second);
     145#else
    128146    time_t tt = time(NULL);
    129147    char* pszDate = (char*)RTMemAlloc(128);
    130148    strftime(pszDate, 128, "Date: %a, %d %b %Y %H:%M:%S UTC", gmtime(&tt));
     149#endif
    131150
    132151    return pszDate;
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette