Back to project page sms_modi.
The source code is released under:
GNU General Public License
If you think the Android project sms_modi listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.zhufeng.sms_mod; // w w w . j a va 2s . c om import java.util.*; import java.text.*; /* * ???????????? * * ????????????Date?????? * Date???getTime()???????1970?1?1? 00:00:00 GMT????????? * ?????????????? ?????????????? * ????????SimpleDateFormat?????????????????????????? * yyyy-MM-DD HH:mm:ss????2012-01-23 20:27:30???? * * ????????1970?????????????????????????????????????? * ??javax.swing?JOptionPane.showInputDialog????? * ????????????Long.parseLong()??????long?????? * ????????Date???setTime()??????????????Date???????????????????? * ????????SimpleDateFormat????????????????????????? * */ public class DateFormatConv { Date dt = new Date(); static Date date_user_input = new Date(); static SimpleDateFormat date_formatter = new SimpleDateFormat( "yyyy-MM-dd HH:mm:ss"); public void getCurrentTime() { System.out.println("??????(?CST????)?" + "\n" + dt + "\n"); System.out.println("??????(??1970????????)?" + "\n" + dt.getTime() + "\n"); System.out.println("?????????????????" + "\n" + date_formatter.format(dt) + "\n"); } public static String convertDateFormat(String date) { String date_converted = null; long dt_user_in = Long.parseLong(date); // System.out.println("???????????" + dt_user_in); date_user_input.setTime(dt_user_in); date_converted = date_formatter.format(date_user_input); System.out.println("?????????????????" + date_converted); return date_converted; } // public static void main(String[] args) { // DateFormatConv conv1 = new DateFormatConv(); // conv1.getCurrentTime(); // System.out.println("****************************"); // // conv1.convertDateFormat(); // System.exit(0); // } }