[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]

[Solved] Why is Android System.currentTimeMillis() not an accurate Timestamp? [duplicate]

While epoch time is measured in seconds, System.currentTimeMillis() returns the time in milliseconds for more accuracy, which is the value you see in the example. If you divide it by 1000 you will get the time in seconds, which will convert to the current epoch time you expect. You can paste the value in here … Read more