[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ast-users
Subject:    [ast-users] Re: [ksh93] 1000 is a magic number for printf '%T'?
From:       "Clark J. Wang" <dearvoid () gmail ! com>
Date:       2011-12-29 12:25:13
Message-ID: CADv8-ogNpbUvaCp=mVUULtWW+Cp1P+w4Cr1r967QjE6KY6Q+eA () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


On Thu, Dec 29, 2011 at 18:03, Clark J. Wang <dearvoid@gmail.com> wrote:

> I find that printf's `%T' format can recognize time strings like "2 days
> ago" or "10 hours later" which is really cool. But then I find that 1000 is
> a magic number for %T. See following examples:
>
> $ echo ${.sh.version}
> Version jM 93u 2011-02-08
> $ printf '%T\n' '1000 days ago'
> Wed Dec 28 10:00:00 CST 2011
> $ printf '%T\n' '1000 minutes ago'
> Thu Dec 29 09:59:00 CST 2011
> $ printf '%T\n' '1000 seconds ago'
> ksh: printf: warning: invalid argument of type T    <-- ???
> Thu Dec 29 10:00:00 CST 2011
>

I forgot to mention that 999 works fine here.

$ printf '%T\n' '999 seconds ago'
Thu Dec 29 20:06:18 CST 2011


> $
> $ printf '%T\n' '201201010101.01 999 days ago'
> Tue Apr  7 01:01:01 CST 2009
> $ printf '%T\n' '201201010101.01 1000 days ago'
> ksh: printf: warning: invalid argument of type T    <-- ???
> Sun Jan  1 01:01:01 CST 2012
> $
>
> I'm confused. Is there a specification about the exact time strings
> supported by ksh?
>
> -Clark
>

[Attachment #5 (text/html)]

On Thu, Dec 29, 2011 at 18:03, Clark J. Wang <span dir="ltr">&lt;<a \
href="mailto:dearvoid@gmail.com">dearvoid@gmail.com</a>&gt;</span> wrote:<br><div \
class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 \
.8ex;border-left:1px #ccc solid;padding-left:1ex">

<font><font face="arial,helvetica,sans-serif">I find that printf&#39;s `%T&#39; \
format can recognize time strings like &quot;2 days ago&quot; or &quot;10 hours \
later&quot; which is really cool. But then I find that 1000 is a magic number for %T. \
See following examples:<br>


<br>$ echo ${.sh.version}<br>Version jM 93u 2011-02-08<br>$ printf &#39;%T\n&#39; \
&#39;1000 days ago&#39;<br>Wed Dec 28 10:00:00 CST 2011<br>$ printf &#39;%T\n&#39; \
&#39;1000 minutes ago&#39;<br>Thu Dec 29 09:59:00 CST 2011<br>


$ printf &#39;%T\n&#39; &#39;1000 seconds ago&#39;<br>ksh: printf: warning: invalid \
argument of type T       &lt;-- ???<br>Thu Dec 29 10:00:00 CST \
2011<br></font></font></blockquote><div><br>I forgot to mention that 999 works fine \
here.<br>

<br>$ printf &#39;%T\n&#39; &#39;999 seconds ago&#39; <br>Thu Dec 29 20:06:18 CST \
2011<br>  </div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt \
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><font><font \
face="arial,helvetica,sans-serif">$<br>

</font></font><font><font face="arial,helvetica,sans-serif">$ printf &#39;%T\n&#39; \
&#39;201201010101.01 999 days ago&#39;<br>

Tue Apr   7 01:01:01 CST 2009<br></font></font><font><font \
face="arial,helvetica,sans-serif">$ printf &#39;%T\n&#39; &#39;201201010101.01 1000 \
days ago&#39;<br>ksh: printf: warning: invalid argument of type T       &lt;-- \
???<br>


Sun Jan   1 01:01:01 CST 2012<br>$<br><br>I&#39;m confused. Is there a specification \
about the exact time strings supported by ksh?<span class="HOEnZb"><font \
color="#888888"><br><br>-Clark<br></font></span></font></font> \
</blockquote></div><br>



_______________________________________________
ast-users mailing list
ast-users@research.att.com
https://mailman.research.att.com/mailman/listinfo/ast-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic