Code examples for GregorianCalendar

Codota analyzed 7,668,838 open source code samples to find the most common, credible and clear examples.
You can now enable Codota on your own code to easily search and navigate your Java codebase.
167:	GregorianCalendar c = new GregorianCalendar(); 
168:	c.setTime(date); 
Full Snippet Info
8
CodeRank
75:	Calendar cal = new GregorianCalendar(); 
76:	cal.setTime(currentTimeout); 
-
78:	Calendar nextTimeout = ((CalendarTimer) timer).getCalendarTimeout().getNextTimeout(cal); 
Full Snippet Info
8
CodeRank
44:	Calendar tmpCal = new GregorianCalendar(calendar.getTimeZone()); 
45:	tmpCal.set(Calendar.YEAR, calendar.get(Calendar.YEAR)); 
46:	tmpCal.set(Calendar.MONTH, calendar.get(Calendar.MONTH)); 
47:	tmpCal.set(Calendar.DAY_OF_MONTH, 1); 
48:	return tmpCal.getActualMaximum(Calendar.DAY_OF_MONTH); 
Full Snippet Info
8
CodeRank
149:	Calendar calendar = new GregorianCalendar(timeZone); 
150:	calendar.clear(); 
151:	calendar.set(year, month, day, hour, minute); 
152:	assertEquals(year, calendar.get(Calendar.YEAR)); 
153:	assertEquals(month, calendar.get(Calendar.MONTH)); 
154:	assertEquals(day, calendar.get(Calendar.DAY_OF_MONTH)); 
155:	assertEquals(hour, calendar.get(Calendar.HOUR_OF_DAY)); 
156:	assertEquals(minute, calendar.get(Calendar.MINUTE)); 
Full Snippet Info
8
CodeRank
204:	java.util.Calendar cal = new GregorianCalendar(); 
205:	StatementCreatorUtils.setParameterValue(preparedStatement, 1, Types.DATE, null, cal); 
206:	verify(preparedStatement).setDate(1, new java.sql.Date(cal.getTime().getTime()), cal); 
Full Snippet Info
8
CodeRank
68:	GregorianCalendar calendar = new GregorianCalendar(); 
69:	calendar.setTimeZone(defaultFormatTimeZone()); 
70:	calendar.setTime(timestamp); 
71:	switch (calendar.get(GregorianCalendar.DAY_OF_MONTH)) { 
Full Snippet Info
8
CodeRank
19:	assertThat(dateRetrieved.get(GregorianCalendar.YEAR)) 
-
22:	assertThat(dateRetrieved.get(GregorianCalendar.MONTH)) 
-
25:	assertThat(dateRetrieved.get(GregorianCalendar.DAY_OF_MONTH)) 
-
28:	assertThat(dateRetrieved.get(GregorianCalendar.HOUR_OF_DAY)) 
-
31:	assertThat(dateRetrieved.get(GregorianCalendar.MINUTE)) 
-
34:	assertThat(dateRetrieved.get(GregorianCalendar.SECOND)) 
Full Snippet Info
8
CodeRank
45:	gc.setTime(startDate); 
-
48:	if (gc.get(Calendar.DAY_OF_WEEK) > meetingDayOfWeek) { 
49:	gc.add(Calendar.WEEK_OF_MONTH, 1); 
-
53:	gc.set(Calendar.DAY_OF_WEEK, meetingDayOfWeek); 
54:	return gc.getTime(); 
Full Snippet Info
8
CodeRank
41:	GregorianCalendar currentCalendar = new GregorianCalendar(); 
-
43:	currentCalendar.get(Calendar.YEAR), 
44:	currentCalendar.get(Calendar.MONTH), 
45:	currentCalendar.get(Calendar.DAY_OF_MONTH), 
Full Snippet Info
7
CodeRank
198:	Calendar calendar = new GregorianCalendar(); 
-
201:	milliseconds += calendar.get(Calendar.ZONE_OFFSET); 
-
204:	calendar.setTime(new Date(milliseconds)); 
205:	milliseconds += calendar.get(Calendar.DST_OFFSET); 
Full Snippet Info
7
CodeRank
65:	Calendar today = new GregorianCalendar(); 
66:	today.set(GregorianCalendar.HOUR_OF_DAY, 0); 
67:	today.set(GregorianCalendar.MINUTE, 0); 
68:	today.set(GregorianCalendar.SECOND, 0); 
69:	today.set(GregorianCalendar.MILLISECOND, 0); 
Full Snippet Info
7
CodeRank
29:	Calendar cal = new GregorianCalendar(); 
30:	cal.setTimeInMillis(file.lastModified()); 
Full Snippet Info
7
CodeRank
43:	Calendar calender = new GregorianCalendar(); 
44:	calender.set(year, month, day, hrs, min, sec); 
Full Snippet Info
7
CodeRank
187:	Calendar calendar = new GregorianCalendar(1970, 1, 1, 0, 0, 0); 
188:	calendar.setTimeZone(TimeZone.getTimeZone("GMT-08:00")); 
189:	calendar.setFirstDayOfWeek(1); 
190:	calendar.setMinimalDaysInFirstWeek(4); 
191:	new SerializableTester<Calendar>(calendar, s).test(); 
Full Snippet Info
8
CodeRank
64:	GregorianCalendar calendar = new GregorianCalendar(); 
65:	calendar.setTime(Clock.currentDate()); 
-
69:	.format(calendar.getTime()); 
-
73:	calendar.add(incrementUnit, increment); 
Full Snippet Info
7
CodeRank
104:	final GregorianCalendar gc = new GregorianCalendar(); 
105:	gc.setTime((Date) o); 
106:	final int year = gc.get(Calendar.YEAR); 
107:	final int month = gc.get(Calendar.MONTH); 
108:	final int day = gc.get(Calendar.DAY_OF_MONTH); 
Full Snippet Info
7
CodeRank
121:	GregorianCalendar gc = new GregorianCalendar(); 
-
125:	gc.set(Calendar.YEAR, year); 
-
127:	int dayOfYear = rint(1, gc.getActualMaximum(Calendar.DAY_OF_YEAR)); 
-
129:	gc.set(Calendar.DAY_OF_YEAR, dayOfYear); 
-
131:	return gc.getTime(); 
Full Snippet Info
7
CodeRank
76:	GregorianCalendar calendar = new GregorianCalendar(); 
77:	calendar.setTime(startDate); 
78:	calendar.add(unit, quantity); 
-
80:	return calendar.getTime(); 
Full Snippet Info
7
CodeRank
39:	GregorianCalendar gc = new GregorianCalendar(); 
40:	gc.setTime(time); 
41:	int month = gc.get(Calendar.MONTH)+1; 
42:	int day = gc.get(Calendar.DAY_OF_MONTH); 
43:	int year = gc.get(Calendar.YEAR); 
Full Snippet Info
7
CodeRank
131:	Calendar newDateCal = new GregorianCalendar(); 
-
133:	newDateCal.setTime(oldDate); 
-
136:	newDateCal.setTime(commandContext.getProcessEngineConfiguration().getClock().getCurrentTime()); 
-
139:	newDateCal.add(Calendar.SECOND, waitTimeInSeconds); 
140:	return newDateCal.getTime(); 
Full Snippet Info
7
CodeRank