简体   繁体   中英

How to get datetime from google calendar

EventDateTime d1 = event.getStart();
SimpleDateFormat outputFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS'Z'");
String outputDate = outputFormat.format(d1.getDate());

I'm unable to get the date in String.

EventDateFormat.getDate() gets
The date, in the format "yyyy-mm-dd", if this is an all-day event.

You probably want to use getDateTime() instead.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM