Advertisement
Guest User

Untitled

a guest
Jul 4th, 2015
176
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. public SimpleDate(long timeMillis) {
  2. this(Calendar.getInstance().setTimeInMillis(timeMillis));//Obviously this doesn't work because setTimeInMillis is a void method
  3. }
  4.  
  5. public SimpleDate(Calendar calendar) {
  6. this.year = calendar.get(Calendar.YEAR);
  7. this.month = calendar.get(Calendar.MONTH) + 1;
  8. this.day = calendar.get(Calendar.DAY_OF_MONTH);
  9.  
  10. this.hour = calendar.get(Calendar.HOUR_OF_DAY);
  11. this.minute = calendar.get(Calendar.MINUTE);
  12. this.second = calendar.get(Calendar.SECOND);
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement