亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

ディレクトリ 検索
Algorithms Algorithms(算法) bsearch bsearch_s qsort qsort_s Atomic operations Atomic operations library(原子操作庫) ATOMIC_*_LOCK_FREE atomic_compare_exchange_strong atomic_compare_exchange_strong_explicit atomic_compare_exchange_weak atomic_compare_exchange_weak_explicit atomic_exchange atomic_exchange_explicit atomic_fetch_add atomic_fetch_add_explicit atomic_fetch_and atomic_fetch_and_explicit atomic_fetch_or atomic_fetch_or_explicit atomic_fetch_sub atomic_fetch_sub_explicit atomic_fetch_xor atomic_fetch_xor_explicit atomic_flag atomic_flag_clear atomic_flag_clear_explicit ATOMIC_FLAG_INIT atomic_flag_test_and_set atomic_flag_test_and_set_explicit atomic_init atomic_is_lock_free atomic_load atomic_load_explicit atomic_signal_fence atomic_store atomic_store_explicit atomic_thread_fence(線程圍欄) ATOMIC_VAR_INIT kill_dependency memory_order(內(nèi)存排序) C keywords auto(自動存儲) break(跳出循環(huán)) C keywords(關(guān)鍵詞) case char const(常量修飾符) continue default(預(yù)設(shè)運(yùn)算式) do double(雙精度浮點(diǎn)型) else enum(枚舉類型) extern(全局變量) float(浮點(diǎn)數(shù)) for fortran goto(goto語句) if(if語句) inline(行內(nèi)函式) int long(長整型) register(寄存器變量) restrict( restrict類型限定符) return short signed sizeof(sizeof運(yùn)算符) static(靜態(tài)變量) struct(結(jié)構(gòu)體) switch(switch語句) typedef(typedef關(guān)鍵字) union(聯(lián)合體) unsigned(無符號) void(空類型) volatile(volatile變量) while(while語句) _Alignas _Alignof _Atomic _Bool _Complex _Generic _Imaginary _Noreturn _Static_assert _Thread_local C language #define directive #elif directive #else directive #endif directive #error directive #if directive #ifdef directive #ifndef directive #include directive #line directive #pragma directive alignas(對齊指定符) Alternative operators and tokens(替代運(yùn)算符和令牌) Analyzability Arithmetic operators Arithmetic types Array declaration(數(shù)組聲明) Array initialization(陣列初始化) ASCII Chart Assignment operators(賦值運(yùn)算符) types(atomic類型限定符) Basic concepts Bit fields(位域) break statement C language C Operator Precedence cast operator character constant(字符字面量) Comments(注釋符) Comparison operators(比較運(yùn)算符) compound literals(符合字面量) Conditional inclusion(條件包含) Conformance(一致性) const type qualifier(const 限定符) Constant expressions(常量表達(dá)) continue statement Declarations(聲明) do-while loop Enumerations(枚舉類型) Escape sequences(轉(zhuǎn)義字符) Expressions(表達(dá)式) External and tentative definitions(外部和暫定的定義) File scope(文件范圍) floating constant(浮點(diǎn)常量) for loop Function declarations(函數(shù)聲明) Function definitions(函數(shù)聲明) Functions Generic selection泛型選擇 goto statement Identifier(標(biāo)示符) if statement Implicit conversions(隱式轉(zhuǎn)換) Increment/decrement operators(前置/后置操作符) Initialization(初始化) inline function specifier(內(nèi)聯(lián)函式) integer constant Lifetime(生命期) Logical operators(邏輯運(yùn)算符) Lookup and name spaces Main function(主函式) Member access operators(會員接入運(yùn)營商) Memory model Objects and alignment(字節(jié)對齊) Order of evaluation(評估順序) Other operators Phases of translation(翻譯階段) Pointer declaration Preprocessor(預(yù)處理) restrict type qualifier(restrict類型限定符) return statement Scalar initialization(標(biāo)量類型初始化) Scope(范圍) sizeof operator(sizeof運(yùn)算符) Statements(陳述) static assert declaration(靜態(tài)斷言聲明) Static storage duration(靜態(tài)存儲周期) Storage-class specifiers(存儲類說明符) string literals(字符串字面量) Struct and union initialization(結(jié)構(gòu)體與聯(lián)合體初始化) Struct declaration(結(jié)構(gòu)體聲明) switch statement Thread storage duration(線程存儲時間) Type Type(類型) Typedef declaration(Typedef聲明) Undefined behavior(未定義行為) Union declaration(聯(lián)合體聲明) Value categories(值類別) Variadic arguments(變長參數(shù)宏) volatile type qualifier(volatile 類型限定符) while loop _Alignof operator _Noreturn function specifier Date and time asctime(asctime函數(shù)) asctime_s clock CLOCKS_PER_SEC clock_t ctime(ctime函數(shù)) ctime_s Date and time utilities(日期和時間庫) difftime(計(jì)算兩個時間的間隔) gmtime gmtime_s localtime localtime_s mktime(將時間結(jié)構(gòu)數(shù)據(jù)轉(zhuǎn)換成經(jīng)過的秒數(shù)的函數(shù)) strftime(格式化輸出時間函數(shù)) time timespec timespec_get time_t tm wcsftime(格式化時間寬字符) Dynamic memory management aligned_alloc C memory management library(內(nèi)存管理庫) calloc free(釋放動態(tài)分配空間的函數(shù)) malloc(動態(tài)分配內(nèi)存空間的函數(shù)) realloc(重新分配內(nèi)存空間的函數(shù)) Error handling abort_handler_s assert(斷言) constraint_handler_t errno(錯誤報告) Error handling(錯誤處理) Error numbers(錯誤個數(shù)) ignore_handler_s set_constraint_handler_s static_assert File input/output clearerr(清除/復(fù)位) fclose feof ferror fflush(清空文件緩沖區(qū)) fgetc fgetpos fgets fgetwc fgetws File input/output fopen fopen_s fprintf fprintf_s fputc fputs fputwc fputws fread freopen freopen_s fscanf fscanf_s fseek fsetpos ftell fwide fwprintf fwprintf_s fwrite fwscanf fwscanf_s getc getchar gets gets_s getwchar perror printf printf_s putc putchar puts putwc putwchar remove rename rewind scanf scanf_s setbuf setvbuf snprintf sprintf sscanf sscanf_s swprintf swprintf_s swscanf swscanf_s tmpfile tmpfile_s tmpnam tmpnam_s ungetc ungetwc vfprintf vfprintf_s vfscanf vfscanf_s vfwprintf vfwprintf_s vfwscanf vfwscanf_s vprintf vprintf_s vscanf vscanf_s vsnprintf vsprintf vsscanf vsscanf_s vswprintf vswprintf_s vswscanf vswscanf_s vwprintf vwprintf_s vwscanf vwscanf_s wprintf wprintf_s wscanf wscanf_s Localization support lconv LC_ALL LC_COLLATE LC_CTYPE LC_MONETARY LC_NUMERIC LC_TIME localeconv Localization support setlocale Numerics abs acos acosf acosh acoshf acoshl acosl asin asinf asinh asinhf asinhl asinl atan atan2 atan2f atan2l atanf atanh atanhf atanhl atanl cabs cabsf cabsl cacos cacosf cacosh cacoshf cacoshl cacosl carg cargf cargl casin casinf casinh casinhf casinhl casinl catan catanf catanh catanhf catanhl catanl cbrt cbrtf cbrtl ccos ccosf ccosh ccoshf ccoshl ccosl ceil ceilf ceill cexp cexpf cexpl cimag cimagf cimagl clog clogf clogl CMPLX CMPLXF CMPLXL Common mathematical functions complex Complex number arithmetic conj conjf conjl copysign copysignf copysignl cos cosf cosh coshf coshl cosl cpow cpowf cpowl cproj cprojf cprojl creal crealf creall csin csinf csinh csinhf csinhl csinl csqrt csqrtf csqrtl ctan ctanf ctanh ctanhf ctanhl ctanl div double_t erf erfc erfcf erfcl erff erfl exp exp2 exp2f exp2l expf expl expm1 expm1f expm1l fabs fabsf fabsl fdim feclearexcept fegetenv fegetexceptflag fegetround feholdexcept feraiseexcept fesetenv fesetexceptflag fesetround fetestexcept feupdateenv FE_ALL_EXCEPT FE_DFL_ENV FE_DIVBYZERO FE_DOWNWARD FE_INEXACT FE_INVALID FE_OVERFLOW FE_TONEAREST FE_TOWARDZERO FE_UNDERFLOW FE_UPWARD Floating-point environment float_t floor floorf floorl fma fmaf fmal fmax fmaxf fmaxl fmin fminf fminl fmod fmodf fmodl fpclassify FP_INFINITE FP_NAN FP_NORMAL FP_SUBNORMAL FP_ZERO frexp frexpf frexpl HUGE_VAL HUGE_VALF HUGE_VALL hypot hypotf hypotl I ilogb ilogbf ilogbl imaginary imaxabs imaxdiv INFINITY isfinite isgreater isgreaterequal isinf isless islessequal islessgreater isnan isnormal isunordered labs ldexp ldexpf ldexpl ldiv lgamma lgammaf lgammal llabs lldiv llrint llrintf llrintl llround llroundf llroundl log log10 log10f log10l log1p log1pf log1pl log2 log2f log2l logb logbf logbl logf logl lrint lrintf lrintl lround lroundf lroundl MATH_ERREXCEPT math_errhandling MATH_ERRNO modf modff modfl nan NAN nanf nanl nearbyint nearbyintf nearbyintl nextafter nextafterf nextafterl nexttoward nexttowardf nexttowardl Numerics pow powf powl Pseudo-random number generation rand RAND_MAX remainder remainderf remainderl remquo remquof remquol rint rintf rintl round roundf roundl scalbln scalblnf scalblnl scalbn scalbnf scalbnl signbit sin sinf sinh sinhf sinhl sinl sqrt sqrtf sqrtl srand tan tanf tanh tanhf tanhl tanl tgamma tgammaf tgammal trunc truncf truncl Type-generic math _Complex_I _Imaginary_I Program support abort atexit at_quick_exit exit EXIT_FAILURE EXIT_SUCCESS getenv getenv_s jmp_buf longjmp Program support utilities quick_exit raise setjmp SIGABRT SIGFPE SIGILL SIGINT signal SIGSEGV SIGTERM sig_atomic_t SIG_DFL SIG_ERR SIG_IGN system _Exit Strings atof atoi atol atoll btowc c16rtomb c32rtomb char16_t char32_t isalnum isalpha isblank iscntrl isdigit isgraph islower isprint ispunct isspace isupper iswalnum iswalpha iswblank iswcntrl iswctype iswdigit iswgraph iswlower iswprint iswpunct iswspace iswupper iswxdigit isxdigit mblen mbrlen mbrtoc16 mbrtoc32 mbrtowc mbsinit mbsrtowcs mbsrtowcs_s mbstate_t mbstowcs mbstowcs_s mbtowc memchr memcmp memcpy memcpy_s memmove memmove_s memset memset_s Null-terminated byte strings Null-terminated multibyte strings Null-terminated wide strings strcat strcat_s strchr strcmp strcoll strcpy strcpy_s strcspn strerror strerrorlen_s strerror_s Strings library strlen strncat Thread support call_once cnd_broadcast cnd_destroy cnd_init cnd_signal cnd_timedwait cnd_wait mtx_destroy mtx_init mtx_lock mtx_plain mtx_recursive mtx_timed mtx_timedlock mtx_trylock mtx_unlock once_flag ONCE_FLAG_INIT thrd_busy thrd_create thrd_current thrd_detach thrd_equal thrd_error thrd_exit thrd_join thrd_nomem thrd_sleep thrd_success thrd_timedout thrd_yield Thread support library thread_local tss_create tss_delete TSS_DTOR_ITERATIONS tss_get tss_set Type support Boolean type support library Fixed width integer types FLT_EVAL_METHOD FLT_ROUNDS max_align_t NULL Numeric limits offsetof ptrdiff_t size_t Type support Variadic functions Variadic functions va_arg va_copy va_end va_list va_start
テキスト

在頭文件<time.h>中定義



size_t strftime(char * str,size_t count,const char * format,const struct tm * time);


(直到C99)

size_t strftime(char * restrict str,size_t count,const char * restrict format,const struct tm * restrict time);


(自C99以來)

根據(jù)格式字符串將日期和時間信息從給定日歷時間轉(zhuǎn)換time為以空字符結(jié)尾的多字節(jié)str字符串format。最多count寫入字節(jié)。

參數(shù)

海峽

-

指向char數(shù)組的第一個元素的輸出



















































































































































































計(jì)數(shù)

-

最大寫入字節(jié)數(shù)



















































































































































































格式

-

指向以空字符結(jié)尾的多字節(jié)字符串指定轉(zhuǎn)換格式的指針。格式字符串由零個或多個轉(zhuǎn)換說明符和普通字符(除%以外)組成。所有普通字符(包括終止空字符)都將被復(fù)制到輸出字符串而不進(jìn)行修改。每個轉(zhuǎn)換規(guī)范都以%字符開頭,可以選擇后跟E或O修飾符(如果語言環(huán)境不支持,則忽略),后面跟著決定說明符行為的字符。以下格式說明符可用:轉(zhuǎn)換說明符說明使用的字段%寫入文字%。完整的轉(zhuǎn)換規(guī)范必須是%%。n(C99)寫入換行符t(C99)寫入水平制表符年份Y以十進(jìn)制數(shù)字寫年,例如 在IS0 8601周內(nèi)從星期一開始,每年的第一周必須滿足以下要求:包括1月4日包括今年的第一個星期四tm_year,tm_wday,tm_yday g(C99)寫出ISO 8601以星期為基礎(chǔ)的年份的最后2位數(shù)字,即包含指定周的年份(范圍00,99)。在IS0 8601周內(nèi)從星期一開始,并且一年中的第一周必須滿足以下要求:包括1月4日包括今年的第一個星期四tm_year,tm_wday,tm_yday月份b寫出縮寫月份名稱,例如Oct(區(qū)域依賴)tm_mon h( C99)b的同義詞tm_mon B寫完整的月份名稱,例如10月(取決于語言環(huán)境)tm_mon m將月份寫為十進(jìn)制數(shù)字(范圍01,12)tm_mon Om(C99)使用替代數(shù)字系統(tǒng)寫月 十二而不是12 ja_JP locale tm_mon周U寫一年中的一周作為十進(jìn)制數(shù)(星期日是一周的第一天)(范圍00,53)tm_year,tm_wday,tm_yday OU(C99)寫一年的周,如%U,使用替代數(shù)字系統(tǒng),例如五十二,而不是ja_JP語言環(huán)境中的52,tm_year,tm_wday,tm_yday W將年份的星期寫為十進(jìn)制數(shù)(星期一是一周中的第一天)(范圍00 ,53)tm_year,tm_wday,tm_yday OW(C99)使用替代數(shù)字系統(tǒng)(例如五十二而不是52)在ja_JP locale tm_year,tm_wday,tm_yday V(C99)中寫入ISO一年中的8601周(范圍01,53)。在IS0 8601周內(nèi)從星期一開始,一年的第一周必須滿足以下要求:包括1月4日包括今年的第一個星期四tm_year,tm_wday,tm_yday OV(C99)寫入年份的星期,如%V,使用替代數(shù)字系統(tǒng),例如五十二,而不是ja_JP語言環(huán)境中的52,tm_year,tm_wday,tm_yday每年的月份/月份j作為十進(jìn)制數(shù)字(范圍001,366)寫入一年中的某一天tm_yday d以十進(jìn)制數(shù)字形式顯示月份的日期(范圍為01,31)tm_mday Od(C99)寫入月份的零基日期使用替代數(shù)字系統(tǒng),例如ja_JP語言環(huán)境中的二十七而不是23單個字符前面有一個空格。tm_mday e(C99)將月份中的某一天寫為十進(jìn)制數(shù)(范圍為1,31)。單個數(shù)字前面有一個空格。tm_mday Oe(C99)使用替代數(shù)字系統(tǒng)編寫一個月的一天,例如 二十七而不是ja_JP語言環(huán)境中的27單個字符前面有一個空格。tm_mday一周中的某天寫一個縮寫星期幾名稱,例如Fri(區(qū)域設(shè)置相關(guān))tm_wday A寫出完整的星期幾名稱,例如星期五(區(qū)域設(shè)置相關(guān))tm_wday w寫入星期幾作為十進(jìn)制數(shù)字,其中星期日為0(范圍0-6)tm_wday Ow(C99)使用替代數(shù)字系統(tǒng)(例如ja_JP區(qū)域設(shè)置tm_wday u(C99)將工作日寫為十進(jìn)制數(shù),其中星期一為1(ISO 8601格式)(范圍1 -7)tm_wday Ou(C99)使用替代數(shù)字系統(tǒng)寫入星期幾,其中星期一為1,例如ja_JP語言環(huán)境中的二代替2代表tm_wday小時,分鐘,秒H將小時數(shù)寫為十進(jìn)制數(shù),

轉(zhuǎn)換說明符

說明

使用的字段

%

寫文字%。完整的轉(zhuǎn)換規(guī)范必須是%%。


N(C99)

寫換行符


噸(C99)

寫水平制表符


將年份寫成十進(jìn)制數(shù)字,例如2017

tm_year

安永(C99)

在替代表示中寫入年份,例如平成23年(平成23年)而不是2011年(2011年)在ja_JP語言環(huán)境中

tm_year

寫一年的最后兩位數(shù)作為十進(jìn)制數(shù)(范圍00,99)

tm_year

Oy(C99)

使用替代數(shù)字系統(tǒng)寫入年份的最后兩位數(shù)字,例如ja_JP語言環(huán)境中的十一而不是11

tm_year

Ey(C99)

將年份寫入與區(qū)域設(shè)置的備選日歷周期的偏移%EC(區(qū)域依賴)

tm_year

C(C99)

將年份的前兩位數(shù)字作為十進(jìn)制數(shù)字(范圍為00,99)

tm_year

EC(C99)

在地區(qū)的替代表示中寫入基準(zhǔn)年(期間)的名稱,例如ja_JP中的平成(平成時代)

tm_year

G(C99)

writes ISO 8601 week-based year, i.e. the year that contains the specified week. In IS0 8601 weeks begin with Monday and the first week of the year must satisfy the following requirements:   Includes January 4   Includes first Thursday of the year

tm_year, tm_wday, tm_yday

g(C99)

writes last 2 digits of ISO 8601 week-based year, i.e. the year that contains the specified week (range 00,99). In IS0 8601 weeks begin with Monday and the first week of the year must satisfy the following requirements:   Includes January 4   Includes first Thursday of the year

tm_year, tm_wday, tm_yday

Month

b

writes abbreviated month name, e.g. Oct (locale dependent)

tm_mon

h(C99)

synonym of b

tm_mon

B

writes full month name, e.g. October (locale dependent)

tm_mon

m

writes month as a decimal number (range 01,12)

tm_mon

Om(C99)

writes month using the alternative numeric system, e.g. 十二 instead of 12 in ja_JP locale

tm_mon

Week

U

writes week of the year as a decimal number (Sunday is the first day of the week) (range 00,53)

tm_year, tm_wday, tm_yday

OU(C99)

writes week of the year, as by %U, using the alternative numeric system, e.g. 五十二 instead of 52 in ja_JP locale

tm_year, tm_wday, tm_yday

W

writes week of the year as a decimal number (Monday is the first day of the week) (range 00,53)

tm_year, tm_wday, tm_yday

OW(C99)

writes week of the year, as by %W, using the alternative numeric system, e.g. 五十二 instead of 52 in ja_JP locale

tm_year, tm_wday, tm_yday

V(C99)

writes ISO 8601 week of the year (range 01,53). In IS0 8601 weeks begin with Monday and the first week of the year must satisfy the following requirements:   Includes January 4   Includes first Thursday of the year

tm_year, tm_wday, tm_yday

OV(C99)

writes week of the year, as by %V, using the alternative numeric system, e.g. 五十二 instead of 52 in ja_JP locale

tm_year, tm_wday, tm_yday

Day of the year/month

j

writes day of the year as a decimal number (range 001,366)

tm_yday

d

writes day of the month as a decimal number (range 01,31)

tm_mday

Od(C99)

writes zero-based day of the month using the alternative numeric system, e.g 二十七 instead of 23 in ja_JP locale Single character is preceded by a space.

tm_mday

e(C99)

writes day of the month as a decimal number (range 1,31). Single digit is preceded by a space.

tm_mday

Oe(C99)

writes one-based day of the month using the alternative numeric system, e.g. 二十七 instead of 27 in ja_JP locale Single character is preceded by a space.

tm_mday

Day of the week

a

writes abbreviated weekday name, e.g. Fri (locale dependent)

tm_wday

A

writes full weekday name, e.g. Friday (locale dependent)

tm_wday

w

writes weekday as a decimal number, where Sunday is 0 (range 0-6)

tm_wday

Ow(C99)

writes weekday, where Sunday is 0, using the alternative numeric system, e.g. 二 instead of 2 in ja_JP locale

tm_wday

u(C99)

writes weekday as a decimal number, where Monday is 1 (ISO 8601 format) (range 1-7)

tm_wday

Ou(C99)

writes weekday, where Monday is 1, using the alternative numeric system, e.g. 二 instead of 2 in ja_JP locale

tm_wday

Hour, minute, second

H

writes hour as a decimal number, 24 hour clock (range 00-23)

tm_hour

OH(C99)

writes hour from 24-hour clock using the alternative numeric system, e.g. 十八 instead of 18 in ja_JP locale

tm_hour

I

writes hour as a decimal number, 12 hour clock (range 01,12)

tm_hour

OI(C99)

writes hour from 12-hour clock using the alternative numeric system, e.g. 六 instead of 06 in ja_JP locale

tm_hour

M

writes minute as a decimal number (range 00,59)

tm_min

OM(C99)

writes minute using the alternative numeric system, e.g. 二十五 instead of 25 in ja_JP locale

tm_min

S

writes second as a decimal number (range 00,60)

tm_sec

OS(C99)

writes second using the alternative numeric system, e.g. 二十四 instead of 24 in ja_JP locale

tm_sec

Other

c

writes standard date and time string, e.g. Sun Oct 17 04:41:13 2010 (locale dependent)

all

Ec(C99)

writes alternative date and time string, e.g. using 平成23年 (year Heisei 23) instead of 2011年 (year 2011) in ja_JP locale

all

x

writes localized date representation (locale dependent)

all

Ex(C99)

writes alternative date representation, e.g. using 平成23年 (year Heisei 23) instead of 2011年 (year 2011) in ja_JP locale

all

X

writes localized time representation (locale dependent)

all

EX(C99)

writes alternative time representation (locale dependent)

all

D(C99)

equivalent to "%m/%d/%y"

tm_mon, tm_mday, tm_year

F(C99)

equivalent to "%Y-%m-%d" (the ISO 8601 date format)

tm_mon, tm_mday, tm_year

r(C99)

寫本地化的12小時時鐘時間(取決于語言環(huán)境)

tm_hour,tm_min,tm_sec

R(C99)

相當(dāng)于“%H:%M”

tm_hour,tm_min

T(C99)

相當(dāng)于“%H:%M:%S”(ISO 8601時間格式)

tm_hour,tm_min,tm_sec

p

寫本地化的上午或下午(區(qū)域依賴)

tm_hour

與(C99)

以ISO 8601格式(例如-0430)寫入UTC的偏移量,如果時區(qū)信息不可用,則不寫入字符

tm_isdst的

寫時區(qū)名稱或縮寫,或者如果時區(qū)信息不可用,則不包含字符(取決于語言環(huán)境)

tm_isdst的

轉(zhuǎn)換說明符

說明

使用的字段



















































































































































































%

寫文字%。完整的轉(zhuǎn)換規(guī)范必須是%%。




















































































































































































N(C99)

寫換行符




















































































































































































噸(C99)

寫水平制表符




















































































































































































| 年份|

| Y | 將年份寫為十進(jìn)制數(shù)字,例如2017 | tm_year |

| EY(C99)| 在替代表示中寫入年份,例如平成23年(平成23年)而不是2011年(2011年)在ja_JP地區(qū)| tm_year |

| y | 將年份的最后2位數(shù)字寫為十進(jìn)制數(shù)(范圍為00,99)| tm_year |

| Oy(C99)| 使用替代數(shù)字系統(tǒng)寫入年份的最后2位數(shù)字,例如ja_JP locale |中的十一而不是11 tm_year |

| Ey(C99)| 將年份寫入與區(qū)域設(shè)置的替代日歷期%EC(區(qū)域依賴)|的偏移量 tm_year |

| C(C99)| 寫一年的前兩位數(shù)作為十進(jìn)制數(shù)(范圍為00,99)| tm_year |

| EC(C99)| 在地區(qū)的替代表示中寫入基準(zhǔn)年(期間)的名稱,例如平成(平成時代)in ja_JP | tm_year |

| G(C99)| 寫ISO 8601以周為基礎(chǔ)的年份,即包含指定周的年份。在IS0 8601周內(nèi)從星期一開始,并且一年中的第一周必須滿足以下要求:包括1月4日包括今年的第一個星期四| tm_year,tm_wday,tm_yday |

| g(C99)| 寫出ISO 8601以周為單位的年份的最后2位數(shù)字,即包含指定周的年份(范圍00,99)。在IS0 8601周內(nèi)從星期一開始,并且一年中的第一周必須滿足以下要求:包括1月4日包括今年的第一個星期四| tm_year,tm_wday,tm_yday |

| 月|

| b | 寫出縮寫的月份名稱,例如Oct(區(qū)域依賴)| tm_mon |

| h(C99)| b |的同義詞 tm_mon |

| B | 寫完整的月份名稱,例如10月(取決于語言環(huán)境)| tm_mon |

| m | 將月份作為十進(jìn)制數(shù)字(范圍為01,12)|寫入 tm_mon |

| Om(C99)| 使用替代數(shù)字系統(tǒng)寫月份,例如ja_JP locale |中的十二而不是12 tm_mon |

| 星期|

| U | 寫一年中的一周作為十進(jìn)制數(shù)(星期日是一周中的第一天)(范圍00,53)| tm_year,tm_wday,tm_yday |

| OU(C99)| 寫一年中的一周,如%U,使用替代數(shù)字系統(tǒng),例如五十二而不是ja_JP語言環(huán)境中的52。tm_year,tm_wday,tm_yday |

| W | 寫一年中的一周作為十進(jìn)制數(shù)(星期一是一周中的第一天)(范圍00,53)| tm_year,tm_wday,tm_yday |

| OW(C99)| 用%W寫出一年中的第一周,使用替代數(shù)字系統(tǒng),例如ja_JP語言環(huán)境中的五十二而不是52。tm_year,tm_wday,tm_yday |

| V(C99)| 寫一年的ISO 8601周(范圍01,53)。在IS0 8601周內(nèi)從星期一開始,并且一年中的第一周必須滿足以下要求:包括1月4日包括今年的第一個星期四| tm_year,tm_wday,tm_yday |

| OV(C99)| 寫出一年中的一周,如%V所示,使用替代數(shù)字系統(tǒng),例如ja_JP語言環(huán)境中的五十二而不是52。tm_year,tm_wday,tm_yday |

| 一年中的每月|

| j | 寫一年中的一天作為十進(jìn)制數(shù)(范圍001,366)| tm_yday |

| d | 將月份的日期寫為十進(jìn)制數(shù)(范圍為01,31)| tm_mday |

| Od(C99)| 使用替代數(shù)字系統(tǒng)寫出從零開始的一天的日期,例如ja_JP語言環(huán)境中的二十七而不是23。單個字符前面有一個空格。| tm_mday |

| e(C99)| 將月份的日期寫為十進(jìn)制數(shù)(范圍1,31)。單個數(shù)字前面有一個空格。| tm_mday |

| Oe(C99)| 使用替代數(shù)字系統(tǒng)寫一個月的一天,例如ja_JP語言環(huán)境中的二十七而不是27。單個字符前面有一個空格。| tm_mday |

| 一周中的星期幾|

| a | 寫縮寫的星期幾名稱,例如Fri(locale dependent)| tm_wday |

| A | 寫完整的星期幾名稱,例如Friday(locale dependent)| tm_wday |

| w | 寫星期幾作為十進(jìn)制數(shù),星期日為0(范圍0-6)| tm_wday |

| Ow(C99)| 寫星期幾,星期日為0,使用替代數(shù)字系統(tǒng),例如ja_JP locale |中的二而不是2 tm_wday |

| 你(C99)| 寫星期幾作為十進(jìn)制數(shù),星期一為1(ISO 8601格式)(范圍1-7)| tm_wday |

| Ou(C99)| 寫星期幾,星期一為1,使用替代數(shù)字系統(tǒng),例如ja_JP locale |中的二而不是2 tm_wday |

| 小時,分鐘,秒|

| H | 將小時數(shù)寫為十進(jìn)制數(shù),24小時制(范圍00-23)| tm_hour |

| OH(C99)| 使用替代數(shù)字系統(tǒng)從24小時制寫小時,例如ja_JP locale |中的十八而不是18 tm_hour |

| 我| 將小時數(shù)寫為十進(jìn)制數(shù),12小時制(范圍01,12)| tm_hour |

| OI(C99)| 使用替代數(shù)字系統(tǒng)從12小時時鐘寫入小時,例如ja_JP locale中的六而不是06 tm_hour |

| M | 將分鐘寫入十進(jìn)制數(shù)(范圍為00,59)| tm_min |

| OM(C99)| 使用替代數(shù)字系統(tǒng)寫分鐘,例如ja_JP locale |中的二十五而不是25 tm_min |

| S | 寫第二個作為十進(jìn)制數(shù)(范圍00,60)| tm_sec |

| OS(C99)| 使用替代數(shù)字系統(tǒng)寫第二個,例如ja_JP locale |中的二十四而不是24 tm_sec |

| 其他|

| c | 寫標(biāo)準(zhǔn)的日期和時間字符串,例如Sun 10月17日04:41:13 2010(取決于語言環(huán)境)| 全部|

| Ec(C99)| 寫替代日期和時間字符串,例如在ja_JP語言環(huán)境中使用平成23年(平成23年)而不是2011年(2011年)全部|

| x | 寫本地化的日期表示法(依賴于語言環(huán)境)| 全部|

| Ex(C99)| 寫替代日期表示法,例如在ja_JP語言環(huán)境中使用平成23年(平成23年)而不是2011年(2011年)全部|

| X | 寫本地化的時間表示(區(qū)域依賴)| 全部|

| EX(C99)| 寫入替代時間表示(取決于語言環(huán)境)| 全部|

| D(C99)| 相當(dāng)于“%m /%d /%y”| tm_mon,tm_mday,tm_year |

| F(C99)| 相當(dāng)于“%Y-%m-%d”(ISO 8601日期格式)| tm_mon,tm_mday,tm_year |

| r(C99)| 寫本地化的12小時時鐘時間(取決于語言環(huán)境)| tm_hour,tm_min,tm_sec |

| R(C99)| 相當(dāng)于“%H:%M”| tm_hour,tm_min |

| T(C99)| 相當(dāng)于“%H:%M:%S”(ISO 8601時間格式)| tm_hour,tm_min,tm_sec |

| p | 寫本地化的上午或下午(區(qū)域依賴)| tm_hour |

| z(C99)| 寫入ISO 8601格式的UTC偏移量(例如-0430),如果時區(qū)信息不可用,則不顯示字符| tm_isdst |

| Z | 寫時區(qū)名稱或縮寫,或者如果時區(qū)信息不可用(取決于語言環(huán)境),則為無字符| tm_isdst |

| 時間|  -  | 指向結(jié)構(gòu)tm對象的指針,指定格式化為|的時間

  • 包括1月4日

  • 包括一年的第一個星期四

tm_year, tm_wday, tm_yday     g

(C99)寫出ISO 8601以周為單位的年份的后兩位數(shù)字,即包含指定周(范圍[00,99])的年份。在IS0 8601周內(nèi)從星期一開始,一年的第一周必須滿足以下要求:

  • 包括1月4日

  • 包括一年的第一個星期四

tm_year,tm_wday,tm_yday     月      b   寫縮寫的月份名稱,例如Oct(位置有關(guān))   tm_mon h

(C99)b tm_mon B   寫完整月份名稱的同義詞,例如October(區(qū)域設(shè)置相關(guān))    tm_mon m   將月份寫為十進(jìn)制數(shù)(范圍[01,12])   tm_mon Om

(C99)寫道使用可替代數(shù)字系統(tǒng),如十二代替12 Ja_JP表示區(qū)域    tm_mon     周      U   寫了一年的星期為十進(jìn)制數(shù)(星期日是一周的第一天)(范圍[00,53])    tm_year,tm_wday,tm_yday OU

(C99)寫道一周年通過,%U使用替代的數(shù)字系統(tǒng),如五十二,而不是在Ja_JP表示區(qū)域52    tm_yeartm_wday,tm_yday W   寫了一年的星期為十進(jìn)制數(shù)(星期一是一周的第一天)(范圍[00,53])    tm_year,tm_wday,tm_yday OW

(C99)寫道星期的一年,通過%W使用替代的數(shù)字系統(tǒng),如五十二,而不是在Ja_JP表示區(qū)域52    tm_yeartm_wday,tm_yday V

(C99)寫入一年中的ISO 8601周(范圍[01,53])。在IS0 8601周內(nèi)從星期一開始,一年的第一周必須滿足以下要求:

  • 包括1月4日

  • 包括一年的第一個星期四

tm_year, tm_wday, tm_yday     OV

(C99)寫入周一年中通過,%V使用替代的數(shù)字系統(tǒng),例如五十二代替Ja_JP表示區(qū)域52    tm_year,tm_wdaytm_yday     年/月的日      j   寫入一年中的哪一天為十進(jìn)制數(shù)(范圍[001,366])    tm_yday d   寫入作為十進(jìn)制數(shù)(范圍[01,31])    的月份tm_mday Od

(C99)使用替代數(shù)字系統(tǒng)編寫月份的零基日期,例如ja_JP語言環(huán)境中的二十七而不是23。單個字符前面有一個空格。

tm_mday     e

(C99)以十進(jìn)制數(shù)(范圍)的形式寫入當(dāng)月的某天[1,31]。單個數(shù)字前面有一個空格。

tm_mday     Oe

(C99)使用替代數(shù)字系統(tǒng)寫一個月一天,例如ja_JP語言環(huán)境中的二十七而不是27。單個字符前面有一個空格。

tm_mday     星期      a   寫簡寫的星期名稱,例如Fri(位置有關(guān))    tm_wday A   寫完整的星期幾的名稱,如Friday(位置有關(guān))    tm_wday w   寫入平日的十進(jìn)制數(shù),星期日為0(范圍[0-6])   tm_wday Ow

(C99)使用替代數(shù)字系統(tǒng)寫周日,其中星期日是0,例如ja_JP語言環(huán)境中的二而不是2   tm_wday u

(C99)將星期幾寫為十進(jìn)制數(shù),星期一為1(ISO 8601格式)(范圍[1-7])   tm_wday Ou

(C99)寫入平日,其中星期一是1,使用備選數(shù)字系統(tǒng),例如,二,而不是在區(qū)域設(shè)置Ja_JP表示2    tm_wday     時,分,秒      H   寫入小時為十進(jìn)制數(shù),24小時時鐘(范圍[00-23])   tm_hour OH

(C99)寫入小時從24小時時鐘使用備選數(shù)字系統(tǒng),例如十八代替18的區(qū)域設(shè)置Ja_JP表示    tm_hour I   寫入小時為十進(jìn)制數(shù),12個小時的時鐘(范圍[01,12])   tm_hour OI

(C99)使用替代數(shù)字系統(tǒng)從12小時時鐘寫入小時,例如ja_JP語言環(huán)境中的六而不是06    tm_hour M   寫入分鐘數(shù)(范圍[00,59])   tm_min OM

(C99)使用替代數(shù)字系統(tǒng)寫入分鐘,例如ja_JP語言環(huán)境中的二十五而不是25    tm_min S   寫入第二個作為十進(jìn)制數(shù)(范圍[00,60])   tm_sec OS

(C99)使用替代數(shù)字系統(tǒng)寫第二個,例如ja_JP語言環(huán)境中的二十四而不是24個    tm_sec     其他      c   寫入標(biāo)準(zhǔn)日期和時間字符串,例如Sun Oct 17 04:41:13 2010(取決于語言環(huán)境)全部     Ec

(C99)寫入備選日期和時間字符串,例如在ja_JP語言環(huán)境中使用平成23年(年平成23年)而不是2011年(2011年),全部      x   寫入本地化日期表示(與語言環(huán)境有關(guān))全部     Ex

(C99)在ja_JP語言環(huán)境中使用平成23年(年平23)而不是2011年(2011年)編寫替代日期表示法,全部      X   寫入本地時間表示(與語言環(huán)境有關(guān))全部     EX

(C99)全部寫入替代時間表示(區(qū)域依賴)     D

(C99),相當(dāng)于“%米/%d /%Y” , ,tm_montm_mdaytm_year F

(C99),相當(dāng)于“%Y-%間- %d” (在ISO 8601的日期格式)    tm_mon,tm_mdaytm_year r

(C99)寫入局部12小時制的時間(當(dāng)前位置有關(guān))    tm_hour,tm_min,tm_sec R

(C99)相當(dāng)于“%H:%M” tm_hour,tm_min T

(C99),相當(dāng)于“%H:%M:%S” (在ISO 8601時間格式)    tm_hour,tm_min,tm_sec p   寫入局部上午或下午(當(dāng)前位置有關(guān))   tm_hour z

(C99)將UTC的偏移量在ISO 8601格式(例如-0430),或沒有字符,如果時區(qū)信息不可    tm_isdst Z   寫入的時區(qū)名稱或縮寫,如果時區(qū)信息不可用,或者沒有文字(語言環(huán)境而定)    tm_isdst        時間 - 指向指定格式化時間的struct tm對象的指針

返回值

寫入字符數(shù)組的字節(jié)數(shù)str不包括終止'\0'成功。如果count在整個字符串可以存儲之前達(dá)到,0則返回并且內(nèi)容未定義。

#include <stdio.h>#include <time.h>#include <locale.h>
 int main(void){
    char buff[70];
    struct tm my_time = { .tm_year=112, // = year 2012                          .tm_mon=9,    // = 10th month                          .tm_mday=9,   // = 9th day                          .tm_hour=8,   // = 8 hours                          .tm_min=10,   // = 10 minutes                          .tm_sec=20    // = 20 secs    }; 
    if (strftime(buff, sizeof buff, "%A %c", &my_time)) {        puts(buff);    } else {        puts("strftime failed");    } 
    setlocale(LC_TIME, "el_GR.utf8"); 
    if (strftime(buff, sizeof buff, "%A %c", &my_time)) {        puts(buff);    } else {        puts("strftime failed");    }}

輸出:

Sunday Sun Oct  9 08:10:20 2012Κυριακ? Κυρ 09 Οκτ 2012 08:10:20 πμ EST

參考

  • C11標(biāo)準(zhǔn)(ISO / IEC 9899:2011):

    • 7.27.3.5 strftime函數(shù)(p:394-397)

  • C99標(biāo)準(zhǔn)(ISO / IEC 9899:1999):

    • 7.23.3.5 strftime函數(shù)(p:343-347)

  • C89 / C90標(biāo)準(zhǔn)(ISO / IEC 9899:1990):

    • 4.12.3.5 strftime函數(shù)

前の記事: 次の記事: