[Solved] Getting time of special timezone in UNIX-time format. Android [duplicate]


I just needed adding an offset of my timezone. Function below was exactly what i wanted!

public static long getCurrentTimeInUnixFormat(){
    return (System.currentTimeMillis()
            + TimeZone.getTimeZone("GMT+3").getOffset(System.currentTimeMillis())) / 1000;
}

1

solved Getting time of special timezone in UNIX-time format. Android [duplicate]