Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public SimpleDate(long timeMillis) {
- this(Calendar.getInstance().setTimeInMillis(timeMillis));//Obviously this doesn't work because setTimeInMillis is a void method
- }
- public SimpleDate(Calendar calendar) {
- this.year = calendar.get(Calendar.YEAR);
- this.month = calendar.get(Calendar.MONTH) + 1;
- this.day = calendar.get(Calendar.DAY_OF_MONTH);
- this.hour = calendar.get(Calendar.HOUR_OF_DAY);
- this.minute = calendar.get(Calendar.MINUTE);
- this.second = calendar.get(Calendar.SECOND);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement