Created
March 23, 2016 10:48
-
-
Save kocyigityunus/443b991d0570efd0975b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package tr.com.pragmasoft.babylon.other; | |
import java.text.SimpleDateFormat; | |
import java.util.Calendar; | |
import java.util.Date; | |
/** | |
* Created by kocyigityunus on 08/03/16. | |
*/ | |
public class DateDeneme { | |
public static void dene(){ | |
try{ | |
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"); | |
Calendar calendar1 = Calendar.getInstance(); | |
Date date1 = sdf.parse( "2016-03-08T21:30:00" ); | |
calendar1.setTime( date1 ); | |
calendar1.setFirstDayOfWeek(Calendar.SUNDAY); | |
calendar1.setMinimalDaysInFirstWeek(4); | |
int weekOfYear1 = calendar1.get(Calendar.WEEK_OF_YEAR); | |
String strDate2 = "2016-03-09T21:30:00"; | |
Calendar calendar2 = Calendar.getInstance(); | |
Date date2 = sdf.parse(strDate2); | |
calendar2.setTime( date2 ); | |
calendar2.setFirstDayOfWeek(Calendar.SUNDAY); | |
calendar2.setMinimalDaysInFirstWeek(4); | |
int weekOfYear2 = calendar2.get(Calendar.WEEK_OF_YEAR); | |
String strDate3 = "2016-03-10T21:30:00"; | |
Calendar calendar3 = Calendar.getInstance(); | |
Date date3 = sdf.parse(strDate3); | |
calendar3.setTime( date3 ); | |
calendar3.setFirstDayOfWeek(Calendar.SUNDAY); | |
calendar3.setMinimalDaysInFirstWeek(4); | |
int weekOfYear3 = calendar3.get(Calendar.WEEK_OF_YEAR); | |
int a = 5; | |
int b = a + 2; | |
}catch (Exception ex){ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment