Be careful when you're using Date for your java application.
When you have a different timezone setting between your application client and the application server host, you may see time different with what you want.
Like:
Date dt = new Date();
It will show you a time with your local timezone, when you're wring a jsp file which need to get the current time, it will not be the server time.
Try use Calendar instead:
Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT-07:00"));
[@more@]Something tiny but really helps.来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21084389/viewspace-1032259/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/21084389/viewspace-1032259/