diff options
-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; |