Simple implementation of jsp countdown and jsp countdown

Source: Internet
Author: User

Simple implementation of jsp countdown and jsp countdown

This article describes the simple implementation of jsp countdown. We will share this with you for your reference. The details are as follows:

<% @ Page language = "java" import = "java. util. * "pageEncoding =" UTF-8 "%> <% // current time in milliseconds Long current_time1 = System. currentTimeMillis (); // End Time in milliseconds Long end_time2 = 1334775200000l; // time difference in calculation Long time2 = end_time2-current_time1; // converts to int second = (int) (time2/1000); // The total number of seconds remaining // set the number of seconds to the specified number of days int s = second % 60; // The number of seconds int mi = (second-s)/60% 60; // minute int h = (second-s)/60-mi)/60% 24; // hour int d = (second-s)/60-mi) /60-h)/24; // day String ret = "remaining: "+ d +" day "+ h +" Hour "+ mi +" Minute "+ s +" second "; // System. out. println (ret); %>

I hope this article will help you with JSP program design.

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.