cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Share your feedback on the Document Scanning Experience in the Dropbox App right here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: V2 getServerModified date format

V2 getServerModified date format

andrew r.46
New member | Level 2
Go to solution

I'm transitioning to v2 on Android. I use the modified date and time to know when is a good time to backup again.

 

In the migration documentation it says:

Date formats

 

When I use:

SearchResult searchResult = dbxClientV2.files().search("", KEY_WEEKLY_FILE_NAME);
FileMetadata fileMeta = (FileMetadata) searchResult.getMatches().get(0).getMetadata();
fileMeta.getServerModified().toString()

I'm getting the following format:

Wed Apr 26 17:13:03 EDT 2017

I can format this with relative ease, but I'm expecting the ISO 8601 format and I'm concerned it will change at some point without warning, or perhaps I'm doing something wrong?

1 Accepted Solution

Accepted Solutions

Greg-DB
Dropbox Staff
Go to solution

The documentation you quoted is referring to the format sent by the API in the HTTP response itself. That format is stable.

 

When using the Java SDK, the responses are translated into native objects for you. For example, FileMetadata.getServerModified returns a Java Date object. The Java Date.toString method by default does give a date string of the format "dow mon dd hh:mm:ss zzz yyyy". The stability of that format is up to the stability of Java. You can alteratively format it however you want, e.g., using DateFormat.

View solution in original post

2 Replies 2

Greg-DB
Dropbox Staff
Go to solution

The documentation you quoted is referring to the format sent by the API in the HTTP response itself. That format is stable.

 

When using the Java SDK, the responses are translated into native objects for you. For example, FileMetadata.getServerModified returns a Java Date object. The Java Date.toString method by default does give a date string of the format "dow mon dd hh:mm:ss zzz yyyy". The stability of that format is up to the stability of Java. You can alteratively format it however you want, e.g., using DateFormat.

andrew r.46
New member | Level 2
Go to solution
Fantastic, thank you very much
Need more support?