How can I get the current system date and a value of 30 days for the current system date!

Source: Internet
Author: User

<% @ Page import = "Java. Text. *" %>

<% @ Page import = "Java. util. *" %>
<%
Simpledateformat formatter1 = new simpledateformat ("yyyy-mm-dd ");
Java. util. Date mydate = new java. util. Date ();
Long mytime = (mydate. gettime ()/1000) + 60*60*24*30;
Mydate. settime (mytime * 1000 );
String mdate = formatter1.format (mydate );
Out. println (mdate );
%>
// Define two strings to respectively obtain the current system date and add a value of 30 days to the current system date.
<%
Date = new date ();
Simpledateformat simpledateformat_date = new simpledateformat ("mm DD, YYYY ");
String systemdate = simpledateformat_date.format (date );
Long mytime = (date. gettime ()/1000) + 60*60*24*30;
Date. settime (MySQL * 1000 );
String mdate = simpledateformat_date.format (date );
%>

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.