I have problems with Date class in Java. Date class returns local machine date but i need UTC-0.
How to get UTC+0 date in Java 8?
With Java 8 you can write:
ZonedDateTime utc = ZonedDateTime.now(ZoneOffset.UTC);
To answer your comment, you can then convert it to a Date (unless you depend on legacy code I don't see any reason why) or to millis since the epochs:
Date date = Date.from(utc.toInstant()); long epochMillis = utc.toEpochSecond() * 1000;