1 '\" te 2 .\" Copyright (c) 2002, Sun Microsystems, Inc. All Rights Reserved Portions Copyright (c) 1992, X/Open Company Limited All Rights Reserved 3 .\" Sun Microsystems, Inc. gratefully acknowledges The Open Group for permission to reproduce portions of its copyrighted documentation. Original documentation from The Open Group can be obtained online at 4 .\" http://www.opengroup.org/bookstore/. 5 .\" The Institute of Electrical and Electronics Engineers and The Open Group, have given us permission to reprint portions of their documentation. In the following statement, the phrase "this text" refers to portions of the system documentation. Portions of this text are reprinted and reproduced in electronic form in the Sun OS Reference Manual, from IEEE Std 1003.1, 2004 Edition, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 6, Copyright (C) 2001-2004 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between these versions and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html. 6 .\" This notice shall appear on any product containing this material. 7 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License"). You may not use this file except in compliance with the License. 8 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing. See the License for the specific language governing permissions and limitations under the License. 9 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner] 10 .TH FTIME 3C "Jul 24, 2002" 11 .SH NAME 12 ftime \- get date and time 13 .SH SYNOPSIS 14 .LP 15 .nf 16 #include <sys/timeb.h> 17 18 \fBint\fR \fBftime\fR(\fBstruct timeb *\fR\fItp\fR); 19 .fi 20 21 .SH DESCRIPTION 22 .sp 23 .LP 24 The \fBftime()\fR function sets the \fBtime\fR and \fBmillitm\fR members of the 25 \fBtimeb\fR structure pointed to by \fItp\fR. The structure is defined in 26 <\fBsys/timeb.h\fR> and contains the following members: 27 .sp 28 .in +2 29 .nf 30 time_t time; 31 unsigned short millitm; 32 short timezone; 33 short dstflag; 34 .fi 35 .in -2 36 37 .sp 38 .LP 39 The \fBtime\fR and \fBmillitm\fR members contain the seconds and milliseconds 40 portions, respectively, of the current time in seconds since 00:00:00 UTC 41 (Coordinated Universal Time), January 1, 1970. 42 .sp 43 .LP 44 The \fBtimezone\fR member contains the local time zone. The \fBdstflag\fR 45 member contains a flag that, if non-zero, indicates that Daylight Saving time 46 applies locally during the appropriate part of the year. 47 .sp 48 .LP 49 The contents of the \fBtimezone\fR and \fBdstflag\fR members of \fItp\fR after 50 a call to \fBftime()\fR are unspecified. 51 .SH RETURN VALUES 52 .sp 53 .LP 54 Upon successful completion, the \fBftime()\fR function returns \fB0\fR. 55 Otherwise \fB\(mi1\fR is returned. 56 .SH ERRORS 57 .sp 58 .LP 59 No errors are defined. 60 .SH USAGE 61 .sp 62 .LP 63 For portability to implementations conforming to earlier versions of this 64 document, \fBtime\fR(2) is preferred over this function. 65 .sp 66 .LP 67 The millisecond value usually has a granularity greater than one due to the 68 resolution of the system clock. Depending on any granularity (particularly a 69 granularity of one) renders code non-portable. 70 .SH ATTRIBUTES 71 .sp 72 .LP 73 See \fBattributes\fR(5) for descriptions of the following attributes: 74 .sp 75 76 .sp 77 .TS 78 box; 79 c | c 80 l | l . 81 ATTRIBUTE TYPE ATTRIBUTE VALUE 82 _ 83 Interface Stability Standard 84 .TE 85 86 .SH SEE ALSO 87 .sp 88 .LP 89 \fBdate\fR(1), \fBtime\fR(2), \fBctime\fR(3C), \fBgettimeofday\fR(3C), 90 \fBtimezone\fR(4), \fBattributes\fR(5), \fBstandards\fR(5)