1 .\" Copyright 2014 Garrett D'Amore <garrett@damore.org>
   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 .Dd "Jul 19, 2014"
  11 .Dt FTIME 3C
  12 .Os
  13 .Sh NAME
  14 .Nm ftime
  15 .Nd get date and time
  16 .Sh SYNOPSIS
  17 .In sys/timeb.h
  18 .Ft int
  19 .Fn ftime "struct timeb *tp"
  20 .Sh DESCRIPTION
  21 The
  22 .Fn ftime
  23 function sets the
  24 .Fa time
  25 and
  26 .Fa millitm
  27 members of the
  28 .Ft timeb
  29 structure pointed to by
  30 .Fa tp .
  31 The structure is defined in
  32 .In sys/timeb.h
  33 and contains the following members:
  34 .Bl -column "unsigned short" "timezone" -offset indent
  35 .It Ft time_t Ta Fa time ;
  36 .It Ft unsigned short Ta Fa millitim ;
  37 .It Ft short Ta Fa timezone ;
  38 .It Ft short Ta Fa dstflag ;
  39 .El
  40 .Lp
  41 The
  42 .Fa time
  43 and
  44 .Fa millitm
  45 members contain the seconds and milliseconds
  46 portions, respectively, of the current time in seconds since 00:00:00 UTC
  47 (Coordinated Universal Time), January 1, 1970.
  48 .Lp
  49 The
  50 .Fa timezone
  51 member contains the local time zone. The
  52 .Fa dstflag
  53 member contains a flag that, if non-zero, indicates that Daylight Saving Time
  54 applies locally during the appropriate part of the year.
  55 .Lp
  56 The contents of the
  57 .Fa timezone
  58 and
  59 .Fa dstflag
  60 members of
  61 .Fa tp
  62 after a call to
  63 .Fn ftime
  64 are unspecified.
  65 .Sh RETURN VALUES
  66 .Rv -std
  67 .Sh ERRORS
  68 No errors are defined.
  69 .Sh USAGE
  70 Portable applications should use either
  71 .Xr time 2 ,
  72 or, if sub-second precision is required,
  73 .Xr clock_gettime 3C .
  74 .Lp
  75 The millisecond value usually has a granularity greater than one due to the
  76 resolution of the system clock.  Depending on any granularity (particularly a
  77 granularity of one) renders code non-portable.
  78 .Sh INTERFACE STABILITY
  79 .Sy Obsolete Standard .
  80 .Sh MT-LEVEL
  81 .Sy Safe .
  82 .Sh SEE ALSO
  83 .Xr date 1 ,
  84 .Xr time 2 ,
  85 .Xr clock_gettime 3C ,
  86 .Xr ctime 3C ,
  87 .Xr gettimeofday 3C ,
  88 .Xr timezone 4 ,
  89 .Xr standards 5
  90 .Sh STANDARDS
  91 The
  92 .Fn ftime
  93 function was introduced in
  94 .St -xpg4.2 .
  95 It was subsequently obsoleted in
  96 .St -p1003.1-2001
  97 and removed from
  98 .St -p1003.1-2008 .