SyntaxFix
Write A Post
Hire A Developer
Questions
The most straigthforward way that makes full use of the huge TimeZone Database of Java and is correct:
long currentTime = new Date().getTime(); long dateOnly = currentTime + TimeZone.getDefault().getOffset(currentTime);