Android Calendar Set setDate(Calendar cal, long date)

Here you can find the source of setDate(Calendar cal, long date)

Description

set Date

License

Open Source License

Declaration

public static void setDate(Calendar cal, long date) 

Method Source Code

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

import java.util.Calendar;

public class Main {
    public static void setDate(Calendar cal, long date) {
        int year = (int) (date / 10000);
        int month = (int) ((date / 100) % 100);
        int day = (int) (date % 100);
        cal.set(year, month - 1, day);//from   www.  j  a v a  2  s .co  m
    }
}

Related

  1. setToDec31(Calendar c)
  2. modify(Calendar val, int field, boolean round)
  3. prepareCalendar(int hourOfDay, int minute)
  4. toDateTime(Calendar calendar)
  5. stripTime(Calendar cal)
  6. setTime(Calendar cal, long time)
  7. moveToDate(int field, int amount)