I'm running into an issue with the 'setModifiedDate()' method of the 'Google Drive Web APIs', and I don't know if it is by design, or a bug.
When updating modified date using the following construct:
DateTime md = DateTime.parseRfc3339("2014-11-02T12:09:58.000-07:00");
File body = new File().setModifiedDate(md);
service.files().patch(id, body).setSetModifiedDate(true).execute();
the date/time updates correctly. Notice that input DateTime variable md can be shown as
2014-11-02T12:09:58.000-07:00, and
md.getTimeZoneShift() reports -420 minutes
When later reading the file's modified date using for instance this construct:
FileList gLst = service.files().list().execute();
for (File gFl : gLst.getItems())
md = gFl.getModifiedDate();
the DateTime 'md' variable holds the correct GMT time, but the time shift (UTC offset) info is lost. the time would be reported as
2014-11-02T19:09:58.000Z and
md.getTimeZoneShift() reports 0 minutes
which certainly IS CORRECT ZULU (GMT) time for the file, but the fact that it was modified from my timezone (GMT-07:00) is lost. I would expect to get the same DateTime format, i.e.
2014-11-02T12:09:58.000-07:00
and md.getTimeZoneShift() reports -420 minutes
as I patched.
Is it the correct behavior, or am I missing something?
0 comments:
Post a Comment