How do I create a Unix timestamp on Android?
I want to create a URL post request with a Unix timestamp on the end of the url.
long unixTime = System.currentTimeMillis() / 1000L;
Aleks G
It's quite simple:
long timestamp = Calendar.getInstance().getTime() / 1000;
来源:https://stackoverflow.com/questions/10177552/how-do-i-create-a-unix-timestamp-on-android