Android in System.currenttimemillis ()

Source: Internet
Author: User
<span id="Label3"></p><p><p><span style="font-size:18px">Function:<br>System.currenttimemillis ();</span></p></p><p><p><span style="font-size:18px">Function: produces a current millisecond, which is actually the number of milliseconds since 0 o'clock January 1, 1970, and date () is actually equivalent to date (system.currenttimemillis ());</span></p></p><p><p><span style="font-size:18px">Because the date class also constructs a date (long date), it is used to calculate the millisecond difference between long seconds and January 1, 1970.</span></p></p><p><p><span style="font-size:18px"><br></span></p></p><p><p><span style="font-size:18px">Gets the number of MILLISECONDS. The use of the function calendar is finally the result of the month, day and SECONDS.</span></p></p><p><p><span style="font-size:18px">System.currenttimemillis ();</span></p></p><p><p><span style="font-size:18px">Obtained is the time distance from 1970-1-01 00:00:00.000 to the current moment, the type is long</span></p></p><span style="font-size:18px"><span style="font-size:18px">string.valueof (system.currenttimemillis ()) This statement can be converted to the following pattern:<br>Long ct = System.currenttimemillis ();<br>String t = string.valueof (ct);<br></span></span><p><p><span style="font-size:18px">In fact, the above string T is equivalent to ct+ "", just to the string format.</span></p></p><p><p><span style="font-size:18px"><br></span></p></p><p><p><span style="font-size:18px"></span></p></p><pre name="code" class="java"><pre name="code" class="java">Public String refformatnowdate () { Date nowtime = new Date (system.currenttimemillis ()); SimpleDateFormat sdformatter = new SimpleDateFormat ("yyyy-mm-dd"); String retstrformatnowdate = Sdformatter.format (nowtime); Return retstrformatnowdate;}</pre></pre><br><br><p><p></p></p><p><p><span style="font-size:18px"><br></span></p></p><p><p><span style="font-size:18px"><br></span></p></p><p><p><span style="font-size:18px"><br></span></p></p> <p><p>Android in System.currenttimemillis ()</p></p></span>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.