Tag Archives: date

5,028 views

Date getDate is deprecated Java Android

Date getDate is deprecated Java Android example code:   long dayInMili = 100000000;   GregorianCalendar calToDay = new GregorianCalendar(); int nD = calToDay.get((Calendar.MILLISECOND)); // +dayInMili; System.out.println(nD);   long lTime = calToDay.getTimeInMillis(); System.out.println(lTime);   Date dtA = new Date(lTime); // today … Continue reading

Posted in Android Examples Code | Tagged , , | Comments Off on Date getDate is deprecated Java Android
14,983 views

How are you old – date calendar age Java Android example

Calendar dateOfYourBirth = new GregorianCalendar(1998, Calendar.SEPTEMBER, 17); Calendar today = Calendar.getInstance(); Android example. public class HoriziontalScrollActivity extends Activity { TextView txtV; Context cntx;   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtV = (TextView)findViewById(R.id.idLabel); cntx = this; StringBuilder strBuild … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on How are you old – date calendar age Java Android example
5,315 views

Leap year date time Java Android example

GregorianCalendar cal = new GregorianCalendar(); Boolean b = cal.isLeapYear(2012); // true, Android example. public class MainActivity extends Activity { TextView txtV; Context cntx;   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtV = (TextView)findViewById(R.id.idLabel); cntx = this; StringBuilder strBuild … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Leap year date time Java Android example
7,290 views

Date time difference determine which is earlier Android Java example

Date difference in millisecond between two date, GregorianCalendar, Calendar, after(), befor(), getTimeInMillis().   public class HoriziontalScrollActivity extends Activity { TextView txtV; Context cntx;   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtV = (TextView)findViewById(R.id.idLabel); cntx = this; StringBuilder strBuild … Continue reading

Posted in Android Examples Code | Tagged , , , , | Comments Off on Date time difference determine which is earlier Android Java example
5,685 views

Date Calendar Java Android Example

Calendar cal = new GregorianCalendar(), int year = cal.get(Calendar.YEAR), ERA, MONTH, DAY_OF_MONTH, DAY_OF_WEEK, Android example code. public class MainActivity extends Activity { TextView txtV; Context cntx;   @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); txtV = (TextView)findViewById(R.id.idLabel); cntx = … Continue reading

Posted in Android Examples Code | Tagged , , , | Comments Off on Date Calendar Java Android Example