Android日历DTSTART和DTEND的困境

Android日历DTSTART和DTEND的困境,android,calendar,Android,Calendar,我需要在我的Android应用程序中插入日历条目。现在我知道我不应该使用这种方法,但仍然。我相信我不是唯一一个在附近的人。。。我已经在stackoverflow和Internet上进行了大量搜索,以了解我今天的代码 事情是,这件事出现了,但日期不对,比如1972年。我做错了什么 这是我的密码: private void insertCalendar(int calChoice) { ContentValues event = new ContentValues(); event.

我需要在我的Android应用程序中插入日历条目。现在我知道我不应该使用这种方法,但仍然。我相信我不是唯一一个在附近的人。。。我已经在stackoverflow和Internet上进行了大量搜索,以了解我今天的代码

事情是,这件事出现了,但日期不对,比如1972年。我做错了什么

这是我的密码:

private void insertCalendar(int calChoice) {
    ContentValues event = new ContentValues();
    event.put("calendar_id", calChoice);
    event.put("title", "WOOT");
    event.put("description", "Wootification");
    event.put("eventLocation", "Wootness");
    event.put("allDay", 0); 
    event.put("eventStatus", 1);
    event.put("visibility", 0);
    event.put("transparency", 0);
    event.put("hasAlarm", 0);

    Calendar start = Calendar.getInstance();
    start.set(2011, 7, 27, 8, 0, 0);

    Calendar end = Calendar.getInstance();
    end.set(2011, 7, 27, 9, 0, 0);

    long startTime = start.getTimeInMillis();       
    startTime = startTime * 1000;

    long endTime = end.getTimeInMillis();
    endTime = endTime * 1000;

    event.put("dtstart", startTime);
    event.put("dtend", endTime);

    Uri eventsUri = Uri.parse("content://com.android.calendar/events");
    getContentResolver().insert(eventsUri, event);
}

你为什么要乘以1000

getTimeMillis已返回毫秒

你的约会时间过了1000次,你似乎感到满心欢喜