Get Current Month day ... Information about the method that gets the requested IP address, because the database is in time format, so to get the format of seconds and minutes

Source: Internet
Author: User

1. Get the current month and day ... Methods of information

1  Public classCommondate {2 3      Public FinalString year =string.valueof (Calendar.getinstance (). Get (Calendar.year));4      Public FinalString month = string.valueof (Calendar.getinstance (). Get (Calendar.month) +1);5      Public FinalString Day =string.valueof (Calendar.getinstance (). Get (Calendar.day_of_month));6      Public FinalString hour_24 =string.valueof (Calendar.getinstance (). Get (Calendar.hour_of_day));7      Public FinalString Hour_12 =string.valueof (Calendar.getinstance (). Get (Calendar.hour));8      Public FinalString minute =string.valueof (Calendar.getinstance (). Get (Calendar.minute));9      Public FinalString second =string.valueof (Calendar.getinstance (). Get (Calendar.second));Ten      Public FinalString week_of_year =string.valueof (Calendar.getinstance (). Get (Calendar.week_of_year)); One      Public FinalString Week_of_month =string.valueof (Calendar.getinstance (). Get (Calendar.week_of_month)); A      Public FinalString day_of_year =string.valueof (Calendar.getinstance (). Get (Calendar.day_of_year)); -      Public FinalString Day_of_month =string.valueof (Calendar.getinstance (). Get (Calendar.day_of_month)); -      Public FinalString Day_of_week =string.valueof (Calendar.getinstance (). Get (Calendar.day_of_week)); the  -  -  -     /** + * Get current time -      * @returncurrent time, 24 hours yyyy-mm-dd HH:mm:ss format +      */ A      PublicString GetTime24 () { atDate Date =NewDate (); -SimpleDateFormat TimeStamp =NewSimpleDateFormat ("Yyyy-mm-dd HH:mm:ss"); -String time =Timestamp.format (date); -         returnTime ; -}
View Code2. Obtain the requested IP address

3, because the database is the time format, so to get the format of seconds and minutes4, Spring.xml file for the object to pass the list format data

Get Current Month day ... Information about the method that gets the requested IP address, because the database is in time format, so to get the format of seconds and minutes

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.