iphone - Unix时间戳的可读日期?
<p><p>从一个 int 变量 unix 时间戳(类似于 1290341015)开始,有没有办法把它变成一个很好的人类可读的日期字符串? iPhone Mail 应用程序具有理想的日期显示,它在当前时间的上下文中显示时间或日期。</p>
<pre><code>06:47 (a time today)
Yesterday (received yesterday)
Friday (received last Friday)
09/11/2010(received more than a week ago)
</code></pre>
<p>有没有办法近似这个?</p></p>
<br><hr><h1><strong>Best Answer-推荐答案</ strong></h1><br>
<p><ul>
<li> <a href="https://stackoverflow.com/questions/11/how-do-i-calculate-relative-time" rel="noreferrer noopener nofollow">Calculate relative time in C#</a> </li>
<li> <a href="https://stackoverflow.com/questions/822124/fuzzy-date-algorithm" rel="noreferrer noopener nofollow">Fuzzy date algorithm</a> </li>
<li> <a href="https://stackoverflow.com/questions/902950/iphone-convert-date-string-to-a-relative-time-stamp" rel="noreferrer noopener nofollow">iPhone: Convert date string to a relative time stamp</a> </li>
</ul>
<p>这个问题已经被问过很多次了。最后一个链接是iphone专用的,其他的比较笼统。</p></p>
<p style="font-size: 20px;">关于iphone - Unix时间戳的可读日期?,我们在Stack Overflow上找到一个类似的问题:
<a href="https://stackoverflow.com/questions/4237937/" rel="noreferrer noopener nofollow" style="color: red;">
https://stackoverflow.com/questions/4237937/
</a>
</p>
页:
[1]