Android Calendar Set setTime(Calendar cal, long time)

Here you can find the source of setTime(Calendar cal, long time)

Description

set Time

License

Open Source License

Declaration

public static void setTime(Calendar cal, long time) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.util.Calendar;

public class Main {
    public static void setTime(Calendar cal, long time) {
        int hour = (int) (time / 10000);
        int minute = (int) ((time / 100) % 100);
        int second = (int) (time % 100);
        cal.set(Calendar.HOUR_OF_DAY, hour);
        cal.set(Calendar.MINUTE, minute);
        cal.set(Calendar.SECOND, second);
    }/*from   ww  w  .j a v  a2s  .  c o  m*/
}

Related

  1. modify(Calendar val, int field, boolean round)
  2. prepareCalendar(int hourOfDay, int minute)
  3. toDateTime(Calendar calendar)
  4. stripTime(Calendar cal)
  5. setDate(Calendar cal, long date)
  6. moveToDate(int field, int amount)