Commit bba7b45f authored by yoshiki@chromium.org's avatar yoshiki@chromium.org

Drive: Show local time instead of UTC at "last modified" field of GCache in drive-internals.

This CL show "last modified" date of GCache in local time instead of in UTC.
- Before: 2012-08-03T07:28:26.000Z
- After: 2012-08-03T00:28:26.000

Review URL: https://chromiumcodereview.appspot.com/10852014

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@150127 0039d316-1c4b-4281-b951-d872f2087c98
parent 840eccef
......@@ -587,6 +587,16 @@ std::string FormatTimeAsString(const base::Time& time) {
exploded.hour, exploded.minute, exploded.second, exploded.millisecond);
}
std::string FormatTimeAsStringLocaltime(const base::Time& time) {
base::Time::Exploded exploded;
time.LocalExplode(&exploded);
return base::StringPrintf(
"%04d-%02d-%02dT%02d:%02d:%02d.%03d",
exploded.year, exploded.month, exploded.day_of_month,
exploded.hour, exploded.minute, exploded.second, exploded.millisecond);
}
void PrepareWritableFileAndRun(Profile* profile,
const FilePath& path,
const OpenFileCallback& callback) {
......
......@@ -117,6 +117,8 @@ bool GetTimeFromString(const base::StringPiece& raw_value, base::Time* time);
// Formats a base::Time as an RFC 3339 date/time (in UTC).
std::string FormatTimeAsString(const base::Time& time);
// Formats a base::Time as an RFC 3339 date/time (in localtime).
std::string FormatTimeAsStringLocaltime(const base::Time& time);
// Callback type for PrepareWritableFilePathAndRun.
typedef base::Callback<void (GDataFileError, const FilePath& path)>
......
......@@ -71,7 +71,7 @@ void GetGCacheContents(const FilePath& root_path,
entry->SetBoolean("is_directory", is_directory);
entry->SetBoolean("is_symbolic_link", is_symbolic_link);
entry->SetString("last_modified",
gdata::util::FormatTimeAsString(last_modified));
gdata::util::FormatTimeAsStringLocaltime(last_modified));
files[current] = entry;
total_size += size;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment