⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ctime.3

📁 unix v7是最后一个广泛发布的研究型UNIX版本
💻 3
字号:
.TH CTIME 3 .SH NAMEctime, localtime, gmtime, asctime, timezone \-  convert date and time to ASCII.SH SYNOPSIS.B char *ctime(clock).br.B long *clock;.PP.B #include <time.h>.PP.B struct tm *localtime(clock).br.B long *clock;.PP.B struct tm *gmtime(clock).br.B long *clock;.PP.B char *asctime(tm).br.B struct tm *tm;.PP.B char *timezone(zone, dst).SH DESCRIPTION.I Ctimeconverts a time pointed to by.I clocksuch as returned by.IR time (2)into ASCIIand returns a pointer to a26-character stringin the following form.All the fields have constant width..PP    Sun Sep 16 01:03:52 1973\\n\\0.PP.I Localtimeand.I gmtimereturn pointers to structures containingthe broken-down time..I Localtimecorrects for the time zone and possible daylight savings time;.I gmtimeconverts directly to GMT, which is the time UNIX uses..I Asctimeconverts a broken-down time to ASCII and returns a pointerto a 26-character string..PPThe structure declaration from the include file is:.RS.PP.nf.so /usr/include/time.h.fi.RE.PPThese quantities give the time on a 24-hour clock,day of month (1-31), month of year (0-11), day of week(Sunday = 0), year \- 1900, day of year (0-365),and a flag that is nonzero if daylight saving time is in effect..PPWhen local time is called for,the program consults the system to determine the time zone andwhether the standard U.S.A. daylight saving time adjustment isappropriate.The program knows about the peculiaritiesof this conversion in 1974 and 1975;if necessary,a table for these years can be extended..PP.I Timezonereturns the name of the time zone associated with its first argument,which is measured in minutes westward from Greenwich.If the second argument is 0, the standard name is used,otherwise the Daylight Saving version.If the required name does not appear in a tablebuilt into the routine,the difference from GMT is produced; e.g.in Afghanistan.I timezone(\-(60*4+30), 0)is appropriate because it is 4:30 ahead of GMTand the string.B GMT+4:30is produced..SH "SEE ALSO"time(2).SH BUGSThe return values point to static datawhose content is overwritten by each call.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -