diff options
author | jshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-19 23:37:55 +0000 |
---|---|---|
committer | jshin@chromium.org <jshin@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-19 23:37:55 +0000 |
commit | 15a9c74ac75de0bbc8263c702f776658c52f24d9 (patch) | |
tree | 5ffb83b63fd2ec85f91c2cc8df0cd2a41ae4ff02 /net/url_request | |
parent | 55214eba4f293c323e85a3d84e4343026ef376d5 (diff) | |
download | chromium_src-15a9c74ac75de0bbc8263c702f776658c52f24d9.zip chromium_src-15a9c74ac75de0bbc8263c702f776658c52f24d9.tar.gz chromium_src-15a9c74ac75de0bbc8263c702f776658c52f24d9.tar.bz2 |
In the local file listing, we should pass time in UTC to ICU's date/time formatting apis instead of the localtime.
ICU apis take into account the timezone when formatting and expect to receive time in UTC.
This is an issue only on Windows. On Mac/Linux, we do the 'right thing'.
BUG=15304
TEST=1. Make a local file or two 2. Go to the directory in Chrome 3. The file modification date matches actual time you created the file (a moment ago) instead of being offset by the offset between your time zone and UTC.
Review URL: http://codereview.chromium.org/413002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32566 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'net/url_request')
-rw-r--r-- | net/url_request/url_request_file_dir_job.cc | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/net/url_request/url_request_file_dir_job.cc b/net/url_request/url_request_file_dir_job.cc index a933274..07977b5 100644 --- a/net/url_request/url_request_file_dir_job.cc +++ b/net/url_request/url_request_file_dir_job.cc @@ -122,16 +122,17 @@ void URLRequestFileDirJob::OnListFile( } #if defined(OS_WIN) - FILETIME local_time; - ::FileTimeToLocalFileTime(&data.ftLastWriteTime, &local_time); int64 size = (static_cast<unsigned __int64>(data.nFileSizeHigh) << 32) | data.nFileSizeLow; + // Note that we should not convert ftLastWriteTime to the local time because + // ICU's datetime formatting APIs expect time in UTC and take into account + // the timezone before formatting. data_.append(net::GetDirectoryListingEntry( data.cFileName, std::string(), (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) ? true : false, size, - base::Time::FromFileTime(local_time))); + base::Time::FromFileTime(data.ftLastWriteTime))); #elif defined(OS_POSIX) // TOOD(jungshik): The same issue as for the directory name. |