OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/gdata/gdata_util.h" | 5 #include "chrome/browser/chromeos/gdata/gdata_util.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
560 *parsed_time = base::Time::FromUTCExploded(exploded); | 560 *parsed_time = base::Time::FromUTCExploded(exploded); |
561 if (offset_to_utc_in_minutes != 0) | 561 if (offset_to_utc_in_minutes != 0) |
562 *parsed_time -= base::TimeDelta::FromMinutes(offset_to_utc_in_minutes); | 562 *parsed_time -= base::TimeDelta::FromMinutes(offset_to_utc_in_minutes); |
563 } else { | 563 } else { |
564 *parsed_time = base::Time::FromLocalExploded(exploded); | 564 *parsed_time = base::Time::FromLocalExploded(exploded); |
565 } | 565 } |
566 | 566 |
567 return true; | 567 return true; |
568 } | 568 } |
569 | 569 |
| 570 std::string FormatTimeAsString(const base::Time& time) { |
| 571 base::Time::Exploded exploded; |
| 572 time.UTCExplode(&exploded); |
| 573 return base::StringPrintf( |
| 574 "%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", |
| 575 exploded.year, exploded.month, exploded.day_of_month, |
| 576 exploded.hour, exploded.minute, exploded.second, exploded.millisecond); |
| 577 } |
| 578 |
570 } // namespace util | 579 } // namespace util |
571 } // namespace gdata | 580 } // namespace gdata |
OLD | NEW |