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 3, 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:
      117 +Locale's appropriate date and time representation.
      118 +In the C locale, this format is:
 118  119  .sp
 119  120  .in +2
 120  121  .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).
 128      -.RE
 129      -
 130      -.SS "Standard conforming"
 131      -.sp
 132      -.ne 2
 133      -.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  122  %a %b %e %H:%M:%S %Y
 142  123  .fi
 143  124  .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  125  .sp
 151      -.ne 2
 152      -.na
 153      -\fB\fB%C\fR\fR
 154      -.ad
 155      -.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.
      126 +Other locales may have different locale-specific formats.
 160  127  .RE
 161  128  
 162      -.SS "Standard conforming"
 163  129  .sp
 164  130  .ne 2
 165  131  .na
 166  132  \fB\fB%C\fR\fR
 167  133  .ad
 168  134  .RS 6n
 169  135  Century number (the year divided by 100 and truncated to an integer as a
 170  136  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  137  .RE
 175  138  
 176  139  .sp
 177  140  .ne 2
 178  141  .na
 179  142  \fB\fB%d\fR\fR
 180  143  .ad
 181  144  .RS 6n
 182  145  Day of month [01,31].
 183  146  .RE
↓ open down ↓ 148 lines elided ↑ open up ↑
 332  295  .na
 333  296  \fB\fB%R\fR\fR
 334  297  .ad
 335  298  .RS 6n
 336  299  Time as \fB%H\fR:\fB%M\fR.
 337  300  .RE
 338  301  
 339  302  .sp
 340  303  .ne 2
 341  304  .na
      305 +\fB\fB%s\fR\fR
      306 +.ad
      307 +.RS 6n
      308 +Seconds since 00:00:00 UTC, January 1, 1970.
      309 +.RE
      310 +
      311 +.sp
      312 +.ne 2
      313 +.na
 342  314  \fB\fB%S\fR\fR
 343  315  .ad
 344  316  .RS 6n
 345  317  Seconds [00,60]; the range of values is [00,60] rather than [00,59] to allow
 346  318  for the occasional leap second.
 347  319  .RE
 348  320  
 349  321  .sp
 350  322  .ne 2
 351  323  .na
↓ open down ↓ 28 lines elided ↑ open up ↑
 380  352  \fB\fB%U\fR\fR
 381  353  .ad
 382  354  .RS 6n
 383  355  Week number of year as a decimal number [00,53], with Sunday as the first day
 384  356  of week 1.
 385  357  .RE
 386  358  
 387  359  .sp
 388  360  .ne 2
 389  361  .na
      362 +\fB\fB%v\fR\fR
      363 +.ad
      364 +.RS 6n
      365 +Date as \fB%e\fR-\fB%b\fR-\fB%Y\fR.
      366 +.RE
      367 +
      368 +.sp
      369 +.ne 2
      370 +.na
 390  371  \fB\fB%V\fR\fR
 391  372  .ad
 392  373  .RS 6n
 393  374  The ISO 8601 week number as a decimal number [01,53]. In the ISO 8601
 394  375  week-based system, weeks begin on a Monday and week 1 of the year is the week
 395  376  that includes both January 4th and the first Thursday of the year.  If the
 396  377  first Monday of January is the 2nd, 3rd, or 4th, the preceding days are part of
 397  378  the last week of the preceding year.  See \fBNOTES\fR below.
 398  379  .RE
 399  380  
↓ open down ↓ 69 lines elided ↑ open up ↑
 469  450  .sp
 470  451  .ne 2
 471  452  .na
 472  453  \fB\fB%Z\fR\fR
 473  454  .ad
 474  455  .RS 6n
 475  456  Time zone name or abbreviation, or no bytes if no time zone information exists.
 476  457  .RE
 477  458  
 478  459  .sp
      460 +.ne 2
      461 +.na
      462 +\fB\fB%+\fR\fR
      463 +.ad
      464 +.RS 6n
      465 +Locale's date and time representation as produced by \fBdate\fR(1).
      466 +.RE
      467 +
      468 +.sp
 479  469  .LP
 480  470  If a conversion specification does not correspond to any of the above or to any
 481  471  of the modified conversion specifications listed below, the behavior is
 482  472  undefined and \fB0\fR is returned.
 483  473  .sp
 484  474  .LP
 485  475  The difference between \fB%U\fR and \fB%W\fR (and also between modified
 486  476  conversion specifications \fB%OU\fR and \fB%OW\fR) lies in which day is counted
 487  477  as the first of the week. Week number 1 is the first week in January starting
 488  478  with a Sunday for \fB%U\fR or a Monday for \fB%W\fR. Week number 0 contains
↓ open down ↓ 292 lines elided ↑ open up ↑
 781  771  decision.
 782  772  .sp
 783  773  .LP
 784  774  The conversion specification for \fB%u\fR was changed in the Solaris 8 release.
 785  775  This change was based on the XPG4 specification.
 786  776  .sp
 787  777  .LP
 788  778  If using the \fB%Z\fR specifier and \fBzoneinfo\fR timezones and if the input
 789  779  date is outside the range 20:45:52 UTC, December  13, 1901 to 03:14:07 UTC,
 790  780  January 19, 2038, the timezone name may not be correct.
      781 +.sp
      782 +.LP
      783 +The conversion specification for \fB%+\fR was added in illumos.
      784 +It is not part of any standard, although it is available on a number
      785 +of other platforms.
      786 +Its use is discouraged for conforming applications.
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX