Print this page
4378 Clean up %C in *time() functions
438 need documentation for strftime %s flag

Split Close
Expand all
Collapse all
          --- old/usr/src/man/man3c/strftime.3c
          +++ new/usr/src/man/man3c/strftime.3c
   1    1  '\" te
        2 +.\" Copyright (c) 2014 Gary Mills
   2    3  .\" Copyright (c) 2008, Sun Microsystems, Inc.  All Rights Reserved.
   3    4  .\" Copyright 1989 AT&T
   4    5  .\" Portions Copyright (c) 1992, X/Open Company Limited.  All Rights Reserved.
   5    6  .\" 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
   6    7  .\" http://www.opengroup.org/bookstore/.
   7    8  .\" 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.
   8    9  .\"  This notice shall appear on any product containing this material.
   9   10  .\" 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.
  10   11  .\" 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.
  11   12  .\" 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]
  12      -.TH STRFTIME 3C "Sep 5, 2006"
       13 +.TH STRFTIME 3C "Jan 1, 2014"
  13   14  .SH NAME
  14   15  strftime, cftime, ascftime \- convert date and time to string
  15   16  .SH SYNOPSIS
  16   17  .LP
  17   18  .nf
  18   19  #include <time.h>
  19   20  
  20   21  \fBsize_t\fR \fBstrftime\fR(\fBchar *restrict\fR \fIs\fR, \fBsize_t\fR \fImaxsize\fR,
  21   22       \fBconst char *restrict\fR \fIformat\fR,
  22   23       \fBconst struct tm *restrict\fR \fItimeptr\fR);
↓ open down ↓ 20 lines elided ↑ open up ↑
  43   44  a '\fB%\fR' (percent) character and one or two terminating conversion
  44   45  characters that determine the conversion specification's behavior.  All
  45   46  ordinary characters (including the terminating null byte) are copied unchanged
  46   47  into the array pointed to by \fIs\fR. If copying takes place between objects
  47   48  that overlap, the behavior is undefined. For \fBstrftime()\fR, no more than
  48   49  \fImaxsize\fR bytes are placed into the array.
  49   50  .sp
  50   51  .LP
  51   52  If \fIformat\fR is \fB(char *)0\fR, then the locale's default format is used.
  52   53  For \fBstrftime()\fR the default format is the same as \fB%c\fR; for
  53      -\fBcftime()\fR and \fBascftime()\fR the default format is the same as \fB%C\fR.
       54 +\fBcftime()\fR and \fBascftime()\fR the default format is the same as \fB%+\fR.
  54   55  \fBcftime()\fR and \fBascftime()\fR first try to use the value of the
  55   56  environment variable \fBCFTIME\fR, and if that is undefined or empty, the
  56   57  default format is used.
  57   58  .sp
  58   59  .LP
  59   60  Each conversion specification is replaced by appropriate characters as
  60   61  described in the following list. The appropriate characters are determined by
  61   62  the \fBLC_TIME\fR category of the program's locale and by the values contained
  62   63  in the structure pointed to by \fItimeptr\fR for \fBstrftime()\fR and
  63   64  \fBascftime()\fR, and by the time represented by \fIclock\fR for
↓ open down ↓ 36 lines elided ↑ open up ↑
 100  101  
 101  102  .sp
 102  103  .ne 2
 103  104  .na
 104  105  \fB\fB%B\fR\fR
 105  106  .ad
 106  107  .RS 6n
 107  108  Locale's full month name.
 108  109  .RE
 109  110  
 110      -.SS "Default"
 111  111  .sp
 112  112  .ne 2
 113  113  .na
 114  114  \fB\fB%c\fR\fR
 115  115  .ad
 116  116  .RS 6n
 117      -Locale's appropriate date and time represented as:
 118      -.sp
 119      -.in +2
 120      -.nf
 121      -%a %b %d %H:%M:%S %Y
 122      -.fi
 123      -.in -2
 124      -
 125      -This is the default behavior as well as standard-conforming behavior for
 126      -standards first supported by releases prior to Solaris 2.4. See
 127      -\fBstandards\fR(5).
      117 +Locale's appropriate date and time representation.
 128  118  .RE
 129  119  
 130      -.SS "Standard conforming"
 131  120  .sp
 132  121  .ne 2
 133  122  .na
 134      -\fB\fB%c\fR\fR
 135      -.ad
 136      -.RS 6n
 137      -Locale's appropriate date and time represented as:
 138      -.sp
 139      -.in +2
 140      -.nf
 141      -%a %b %e %H:%M:%S %Y
 142      -.fi
 143      -.in -2
 144      -
 145      -This is standard-conforming behavior for standards first supported by Solaris
 146      -2.4 through Solaris 10.
 147      -.RE
 148      -
 149      -.SS "Default"
 150      -.sp
 151      -.ne 2
 152      -.na
 153  123  \fB\fB%C\fR\fR
 154  124  .ad
 155  125  .RS 6n
 156      -Locale's date and time representation as produced by \fBdate\fR(1).
 157      -.sp
 158      -This is the default behavior as well as standard-conforming behavior for
 159      -standards first supported by releases prior to Solaris 2.4.
 160      -.RE
 161      -
 162      -.SS "Standard conforming"
 163      -.sp
 164      -.ne 2
 165      -.na
 166      -\fB\fB%C\fR\fR
 167      -.ad
 168      -.RS 6n
 169  126  Century number (the year divided by 100 and truncated to an integer as a
 170  127  decimal number [01,99]).
 171      -.sp
 172      -This is standard-conforming behavior for standards first supported by Solaris
 173      -2.4 through Solaris 10.
 174  128  .RE
 175  129  
 176  130  .sp
 177  131  .ne 2
 178  132  .na
 179  133  \fB\fB%d\fR\fR
 180  134  .ad
 181  135  .RS 6n
 182  136  Day of month [01,31].
 183  137  .RE
↓ open down ↓ 148 lines elided ↑ open up ↑
 332  286  .na
 333  287  \fB\fB%R\fR\fR
 334  288  .ad
 335  289  .RS 6n
 336  290  Time as \fB%H\fR:\fB%M\fR.
 337  291  .RE
 338  292  
 339  293  .sp
 340  294  .ne 2
 341  295  .na
      296 +\fB\fB%s\fR\fR
      297 +.ad
      298 +.RS 6n
      299 +Seconds since 00:00:00 UTC, January 1, 1970.
      300 +.RE
      301 +
      302 +.sp
      303 +.ne 2
      304 +.na
 342  305  \fB\fB%S\fR\fR
 343  306  .ad
 344  307  .RS 6n
 345  308  Seconds [00,60]; the range of values is [00,60] rather than [00,59] to allow
 346  309  for the occasional leap second.
 347  310  .RE
 348  311  
 349  312  .sp
 350  313  .ne 2
 351  314  .na
↓ open down ↓ 28 lines elided ↑ open up ↑
 380  343  \fB\fB%U\fR\fR
 381  344  .ad
 382  345  .RS 6n
 383  346  Week number of year as a decimal number [00,53], with Sunday as the first day
 384  347  of week 1.
 385  348  .RE
 386  349  
 387  350  .sp
 388  351  .ne 2
 389  352  .na
      353 +\fB\fB%v\fR\fR
      354 +.ad
      355 +.RS 6n
      356 +Date as \fB%e\fR-\fB%b\fR-\fB%Y\fR.
      357 +.RE
      358 +
      359 +.sp
      360 +.ne 2
      361 +.na
 390  362  \fB\fB%V\fR\fR
 391  363  .ad
 392  364  .RS 6n
 393  365  The ISO 8601 week number as a decimal number [01,53]. In the ISO 8601
 394  366  week-based system, weeks begin on a Monday and week 1 of the year is the week
 395  367  that includes both January 4th and the first Thursday of the year.  If the
 396  368  first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of
 397  369  the last week of the preceding year.  See \fBNOTES\fR below.
 398  370  .RE
 399  371  
↓ open down ↓ 68 lines elided ↑ open up ↑
 468  440  
 469  441  .sp
 470  442  .ne 2
 471  443  .na
 472  444  \fB\fB%Z\fR\fR
 473  445  .ad
 474  446  .RS 6n
 475  447  Time zone name or abbreviation, or no bytes if no time zone information exists.
 476  448  .RE
 477  449  
      450 +.sp
      451 +.ne 2
      452 +.na
      453 +\fB\fB%+\fR\fR
      454 +.ad
      455 +.RS 6n
      456 +Locale's date and time representation as produced by \fBdate\fR(1).
      457 +.RE
      458 +
 478  459  .sp
 479  460  .LP
 480  461  If a conversion specification does not correspond to any of the above or to any
 481  462  of the modified conversion specifications listed below, the behavior is
 482  463  undefined and \fB0\fR is returned.
 483  464  .sp
 484  465  .LP
 485  466  The difference between \fB%U\fR and \fB%W\fR (and also between modified
 486  467  conversion specifications \fB%OU\fR and \fB%OW\fR) lies in which day is counted
 487  468  as the first of the week. Week number 1 is the first week in January starting
↓ open down ↓ 303 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX