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

The following examples show how to use org.joda.time.DateTime#toCalendar() . These examples are extracted from open source projects. 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 want to check out the right sidebar which shows the related API usage.
Example 1
private static Calendar convert(DateTime dateTime) {
   return dateTime == null ? null : dateTime.toCalendar(Locale.getDefault());
}
 
Example 2
private static Calendar convert(DateTime dateTime) {
   return dateTime == null ? null : dateTime.toCalendar(Locale.getDefault());
}
 
Example 3
private static Calendar convert(DateTime dateTime) {
   return dateTime == null ? null : dateTime.toCalendar(Locale.getDefault());
}
 
Example 4
private static Calendar convert(DateTime dateTime) {
   return dateTime == null ? null : dateTime.toCalendar(Locale.getDefault());
}
 
Example 5
private static Calendar convert(DateTime dateTime) {
   return dateTime == null ? null : dateTime.toCalendar(Locale.getDefault());
}
 
Example 6
Source Project: maven-framework-project   File: Jodatime.java    License: 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
/**
 * 还原回jdk的原生Calendar对象
 * 
 * @return
 */
public static Calendar parseCalendar(DateTime dateTime) {
	return dateTime.toCalendar(Locale.getDefault());
}