title: Parsing datetimestamps with timezone offset in Go using google.protobuf.Timestamp
body: <p>I am creating a Go application which will use GRPC and protobuf. My RPC service shall take a message containing the type <code>google.protobuf.Timestamp</code>, parse it and eventually save it in a database or perform some more operations on it. </p>
  
  <p>I am confused as to what is considered valid input for the type <code>google.protobuf.Timestamp</code>. I wish to use the following format for the datetimestamp with the timezone offset.</p>
  
  <p><code>2019-02-15T13:00:00+01:00</code></p>
  
  <p>Here is the proto file I am using.</p>
  
  <pre><code>syntax = "proto3"
  package example;
  import "google/protobuf/timestamp.proto"
  
  service Tester {
   rpc ParseDateTimeStamp(TSRequest) returns (TSReply) {}
  }
  
  message TSRequest {
    google.protobuf.Timestamp dts = 1;
  }
  
  message TSReply {
   string message = 1;
  }
  </code></pre>
  
  <p>The issue is that when I send a message to the GRPC server containing the datetimestamp. I would expect that the type <code>*tsbp.Timestamp</code> for the <code>2019-02-15T13:00:00+01:00</code> datetimestamp given to be valid and give me the appropriate seconds from epoch. (After invoking <code>GetSeconds()</code> from the timestamp.go)</p>
  
  <p>Invoking <code>ptypes.TimestampString(ts *tspb.Timestamp)</code> returns <code>1970-01-01T00:00:00Z</code> for the example input above.</p>
  
  <p>Does the <code>google.protobuf.Timestamp</code> accept datetimestamps with the +- offset?</p>
  
  <p>Or do I have to have the input in a String type and then parse to <code>time.Time</code> with <code>time.Format</code> instead of using the timestamp variable type in protobuf? If so could you provide an example of this? </p>