get Current Timestamp in long for UTC time - Android java.util

Android examples for java.util:Time

Description

get Current Timestamp in long for UTC time

Demo Code


//package com.java2s;

import java.util.Calendar;

import java.util.TimeZone;

public class Main {
    public static long getCurrentTimestamp() {
        return Calendar.getInstance(TimeZone.getTimeZone("UTC"))
                .getTimeInMillis();/*from   w  ww  .j av a2s .  c om*/
    }
}

Related Tutorials