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.