How to initialize Google protocol buffers Timestamp in Java?

Google protocol buffers (3.0.0-beta2) offers the well-known type Timestamp. The documentation describes the initialization in Java using System.currentTimeMillis() as following: long millis = System….

Android Get Current timestamp?

I want to get the current timestamp like that : 1320917972 int time = (int) (System.currentTimeMillis()); Timestamp tsTemp = new Timestamp(time); String ts = tsTemp.toString();