Java Code Examples for org.joda.time.DateTime#toCalendar()

The following examples show how to use org.joda.time.DateTime#toCalendar() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: DateUtils.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private static Calendar convert(DateTime dateTime) {
   return dateTime == null ? null : dateTime.toCalendar(Locale.getDefault());
}
 
Example 2
Source File: DateUtils.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private static Calendar convert(DateTime dateTime) {
   return dateTime == null ? null : dateTime.toCalendar(Locale.getDefault());
}
 
Example 3
Source File: DateUtils.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private static Calendar convert(DateTime dateTime) {
   return dateTime == null ? null : dateTime.toCalendar(Locale.getDefault());
}
 
Example 4
Source File: DateUtils.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private static Calendar convert(DateTime dateTime) {
   return dateTime == null ? null : dateTime.toCalendar(Locale.getDefault());
}
 
Example 5
Source File: DateUtils.java    From freehealth-connector with GNU Affero General Public License v3.0 4 votes vote down vote up
private static Calendar convert(DateTime dateTime) {
   return dateTime == null ? null : dateTime.toCalendar(Locale.getDefault());
}
 
Example 6
Source File: Jodatime.java    From maven-framework-project with MIT License 4 votes vote down vote up
/**
 * 与jdk的时间转换
 */
public static void convertJDK(){
	
	System.out.println("-------------与jdk的时间转换-----------------");
	
	DateTime dt = new DateTime();

	//转换成java.util.Date对象
	
	Date d1 = new Date(dt.getMillis());
	
	Date d2 = dt.toDate();
	
	//转换成java.util.Calendar对象
	Calendar c1 = Calendar.getInstance();
	c1.setTimeInMillis(dt.getMillis());
	
	Calendar c2 = dt.toCalendar(Locale.getDefault());

}
 
Example 7
Source File: DateUtils.java    From xmu-2016-MrCode with GNU General Public License v2.0 2 votes vote down vote up
/**
 * 还原回jdk的原生Calendar对象
 * 
 * @return
 */
public static Calendar parseCalendar(DateTime dateTime) {
	return dateTime.toCalendar(Locale.getDefault());
}