Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(480)

Unified Diff: Source/core/dom/Document.cpp

Issue 394903004: document.lastModified should consider user's local time zone (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase and take review comments into consideration Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 119200bbab8c9615e2c51ec9eb173f850432607c..86310b22b6cb147a61974b692d3e6e561625b666 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -196,6 +196,7 @@
#include "platform/weborigin/SecurityOrigin.h"
#include "public/platform/Platform.h"
#include "wtf/CurrentTime.h"
+#include "wtf/DateMath.h"
#include "wtf/HashFunctions.h"
#include "wtf/MainThread.h"
#include "wtf/StdLibExtras.h"
@@ -4084,7 +4085,7 @@ String Document::lastModified() const
if (DocumentLoader* documentLoader = loader()) {
const AtomicString& httpLastModified = documentLoader->response().httpHeaderField("Last-Modified");
if (!httpLastModified.isEmpty()) {
- date.setMillisecondsSinceEpochForDateTime(parseDate(httpLastModified));
+ date.setMillisecondsSinceEpochForDateTime(convertToLocalTime(parseDate(httpLastModified)));
foundDate = true;
}
}
@@ -4093,7 +4094,7 @@ String Document::lastModified() const
// specificiation tells us to read the last modification date from the file
// system.
if (!foundDate)
- date.setMillisecondsSinceEpochForDateTime(currentTimeMS());
+ date.setMillisecondsSinceEpochForDateTime(convertToLocalTime(currentTimeMS()));
return String::format("%02d/%02d/%04d %02d:%02d:%02d", date.month() + 1, date.monthDay(), date.fullYear(), date.hour(), date.minute(), date.second());
}
« no previous file with comments | « LayoutTests/http/tests/resources/no-last-modified.php ('k') | Source/core/html/forms/BaseDateAndTimeInputType.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698