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

Side by Side Diff: net/der/encode_values.cc

Issue 2091103002: Add CheckOCSPDateValid() to net/cert/internal (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments from rsleevi@ Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/time/time.h"
6 #include "net/der/encode_values.h"
7
8 namespace net {
9
10 namespace der {
11
12 der::GeneralizedTime EncodeTimeAsGeneralizedTime(const base::Time& time) {
13 base::Time::Exploded exploded;
14 time.UTCExplode(&exploded);
Ryan Sleevi 2016/07/01 00:49:53 DESIGN: Check HasValidValues()? API suggestion: b
dadrian 2016/07/01 17:13:43 UTCExplode is void...what error condition are you
Ryan Sleevi 2016/07/01 17:58:07 time.UTCExplode(&exploded); if (!exploded.HasValid
dadrian 2016/07/01 18:41:11 Ah. Done. Will this fix the Windows case / thought
15
16 der::GeneralizedTime result;
17 result.year = exploded.year;
18 result.month = exploded.month;
19 result.day = exploded.day_of_month;
20 result.hours = exploded.hour;
21 result.minutes = exploded.minute;
22 result.seconds = exploded.second;
23 return result;
24 }
25
26 } // namespace der
27
28 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698