Auction site: Show the remaining time of the item related issues

Source: Internet
Author: User
Auction site: Show the remaining time of the product issue
Add an auction item in the background, set the end time of the auction, such as February 22, 2012 22 o'clock in the evening full expiry, this end time is stored in the database is converted to 10-bit UNIX timestamp format.

Front desk shows you're having a problem.

The auction page displays a list of all items, one of which is "time remaining".

This "time remaining" is the "End Time"-"Current server system time" in the database, which is then converted to similar output:
1:11
2 days 1 o'clock

When the number of hours is greater than 24, the number of days and hours is displayed, otherwise the hours and minutes are displayed

If only the calculation of a good point, the problem is that this is a product list page, and I am using the framework MVC pattern, in the template is a loop output auction items records. In the template, the template variable (the field of the end time) cannot be computed separately, as is the case with me?

------Solution--------------------
Calculation is not related to templates
Besides, some templates also support arithmetic
------Solution--------------------
You can also do it in M and then upload it to v.
------Solution--------------------
Use JS Bar ...
  • 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.