diff options
author | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-06 19:09:18 +0000 |
---|---|---|
committer | yoshiki@chromium.org <yoshiki@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-08-06 19:09:18 +0000 |
commit | bba7b45fd533c0a2c772593ff6943c5c87407865 (patch) | |
tree | d54b062e0d24f748a4a3a7693299a99e19b2975c | |
parent | 840eccefff0f2b79e86771216bd71ddde7e5726c (diff) | |
download | chromium_src-bba7b45fd533c0a2c772593ff6943c5c87407865.zip chromium_src-bba7b45fd533c0a2c772593ff6943c5c87407865.tar.gz chromium_src-bba7b45fd533c0a2c772593ff6943c5c87407865.tar.bz2 |
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
-rw-r--r-- | chrome/browser/chromeos/gdata/gdata_util.cc | 10 | ||||
-rw-r--r-- | chrome/browser/chromeos/gdata/gdata_util.h | 2 | ||||
-rw-r--r-- | chrome/browser/ui/webui/chromeos/drive_internals_ui.cc | 2 |
3 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/chromeos/gdata/gdata_util.cc b/chrome/browser/chromeos/gdata/gdata_util.cc index 92a3c78..ea1a16a 100644 --- a/chrome/browser/chromeos/gdata/gdata_util.cc +++ b/chrome/browser/chromeos/gdata/gdata_util.cc @@ -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) { diff --git a/chrome/browser/chromeos/gdata/gdata_util.h b/chrome/browser/chromeos/gdata/gdata_util.h index d7640db..f27d9ee 100644 --- a/chrome/browser/chromeos/gdata/gdata_util.h +++ b/chrome/browser/chromeos/gdata/gdata_util.h @@ -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)> diff --git a/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc b/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc index 9f40a9c..1bc509c 100644 --- a/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc +++ b/chrome/browser/ui/webui/chromeos/drive_internals_ui.cc @@ -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; |