Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0000169 [1003.1(2008)/Issue 7] Shell and Utilities Editorial Enhancement Request 2009-10-15 15:44 2024-02-26 19:55
Reporter wpollock View Status public  
Assigned To ajosey
Priority normal Resolution Accepted As Marked  
Status Applied  
Name Wayne Pollock
Organization
User Reference
Section date
Page Number NA
Line Number NA
Interp Status ---
Final Accepted Text Note: 0000283
Summary 0000169: date utility needs ``%s''
Description There is currently no simple way, short of writing a C program, to obtain the "seconds since the epoch", commonly referred to as "Unix time". I would like to request the date utility be extended to include an additional conversion specification of:

 %s seconds since 1970-01-01 00:00:00 UTC (see XBD Seconds Since the Epoch)
Desired Action Add the new conversion specifier
Tags c99, issue8
Attached Files

- Relationships
parent of 0001612Applied Issue 8 drafts XSH strftime() new (I8) %s conversion requires too much of the struct tm 
parent of 0001797New Issue 8 drafts strftime "%s" should be able to examine tm_gmtoff 
related to 0000047Closedajosey 1003.1(2008)/Issue 7 Missing specifiers for date utility 
related to 0000466Appliedajosey 1003.1(2008)/Issue 7 date +%C problem 
related to 0000954Closedajosey 1003.1(2008)/Issue 7 Add %s to strftime 
Not all the children of this issue are yet resolved or closed.

-  Notes
(0000262)
geoffclare (manager)
2009-10-16 09:07
edited on: 2009-10-16 09:12

If the proposed change to date is made, we should also add %s to
strftime() and strptime() for consistency.

Although it would be kind-of redundant for those functions (being
equivalent to mktime() and localtime() respectively, plus conversion
to/from a string) it would be usable in user-supplied/configured
format strings.

The detailed changes needed would be ...
After line 82902 add:

    %s   Seconds since 1970-01-01 00:00:00 UTC as a decimal number
         (see [xref to XBD 4.15 Seconds Since the Epoch])

Cross-volume changes to XSH:

After page 2009 line 63596 section strftime, add:

[CX]s    Replaced by the number of seconds since 1970-01-01 00:00:00 UTC
         as a decimal number (see [xref to XBD 4.15 Seconds Since the
         Epoch]). [all members, as if by a call to mktime()] [/CX]

After page 2027 line 64161 section strptime, add:

    s    The number of seconds since 1970-01-01 00:00:00 UTC as a
         decimal number (see [xref to XBD 4.15 Seconds Since the
         Epoch]); leading zeros shall be permitted but shall not be
         required.


(0000283)
Don Cragun (manager)
2009-11-05 16:52
edited on: 2016-02-25 16:49

This bug originally added %s to the description of the date utility.
That is no longer done here because the date utility now defers to strftime()
due to changes made in response to 0000466.
Cross-volume changes to XSH:

After page 2009 line 63596 section strftime, add:

[CX]s    Replaced by the number of seconds since the Epoch
         as a decimal number (see [xref to XBD 4.15 Seconds Since the
         Epoch]). [all members, as if by a call to mktime()] [/CX]

At page 2011 line 63686 section strftime(), change:
        Otherwise, 0 shall be returned and the contents of the array are
        unspecified.
to:
        Otherwise, 0 shall be returned, <CX>errno shall be set to indicate
        the error,</CX> and the contents of the array are unspecified.

At page 2011 line 63689 section strftime(), replace the entire ERRORS section with:
       <CX>These functions shall fail if:

        [EOVERFLOW]   The format string includes a %s conversion and the
                     number of seconds since the Epoch cannot be represented
                     in a time_t.

        These functions may fail if:

        [EINVAL]   The format string includes a %s conversion and the number of
                   seconds since the Epoch would be negative.</CX>

After page 2027 line 64161 section strptime, add:

    s    The number of seconds since the Epoch as a
         decimal number (see [xref to XBD 4.15 Seconds Since the
         Epoch]); leading zeros shall be permitted but shall not be
         required.



- Issue History
Date Modified Username Field Change
2009-10-15 15:44 wpollock New Issue
2009-10-15 15:44 wpollock Status New => Under Review
2009-10-15 15:44 wpollock Assigned To => ajosey
2009-10-15 15:44 wpollock Name => Wayne Pollock
2009-10-15 15:44 wpollock Section => date
2009-10-15 15:44 wpollock Page Number => NA
2009-10-15 15:44 wpollock Line Number => NA
2009-10-15 15:45 wpollock Issue Monitored: wpollock
2009-10-16 09:07 geoffclare Note Added: 0000262
2009-10-16 09:07 geoffclare Note Edited: 0000262
2009-10-16 09:12 geoffclare Note Edited: 0000262
2009-11-05 16:51 msbrown Interp Status => ---
2009-11-05 16:51 msbrown Resolution Open => Future Enhancement
2009-11-05 16:52 Don Cragun Note Added: 0000283
2009-11-05 16:54 Don Cragun Final Accepted Text => Note: 0000283
2009-11-05 16:54 Don Cragun Status Under Review => Resolved
2010-09-09 15:47 geoffclare Tag Attached: issue8
2011-06-24 21:00 eblake Relationship added related to 0000047
2011-06-24 21:13 eblake Relationship added related to 0000466
2011-06-30 16:23 Don Cragun Note Edited: 0000283
2011-06-30 16:49 eblake Tag Attached: c99
2011-07-08 15:59 Don Cragun Resolution Future Enhancement => Accepted As Marked
2015-06-04 08:31 geoffclare Relationship added related to 0000954
2016-02-25 16:45 Don Cragun Note Edited: 0000283
2016-02-25 16:48 Don Cragun Note Edited: 0000283
2016-02-25 16:49 Don Cragun Note Edited: 0000283
2019-12-20 11:55 geoffclare Status Resolved => Applied
2024-02-26 19:54 eblake Relationship added parent of 0001612
2024-02-26 19:55 eblake Relationship added parent of 0001797


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker