/* * To change this template, choose Tools | Templates * and open the template in the editor. */ package datetest; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.Date; import java.util.logging.Level; import java.…
Learn From:http://blog.csdn.net/sunhuwh/article/details/39161323 public class CalendarTest { public static void main(String[] args) { // 获取当前年份.月份.日期 Calendar cale = null; cale = Calendar.getInstance(); int year = cale.get(Calendar.YEAR); int month =…
public String getMonday(String date) { if (date == null || date.equals("")) { System.out.println("date is null or empty"); return "0000-00-00 00:00:00"; } SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd")…
随着项目进度的逐步完成,数据传输和界面基本上已经搭建完成,下面就是一些细节部分的修改 今天博文的主要内容说的是获取当前的时间和同Thrift类型的转化 和C#类似,java也有一个时间类Date,加载包import java.util.Date; 实例化Date Date Time = new Date(); 使用.get()方法获取年月日 int year = currTime.getYear();//年 但是在实际使用过程中发现使用.get()方法中间有一道横线,百度了一下,有横线的表示…