Last active
September 27, 2019 23:14
-
-
Save thauansrx/c6bce6bcf86e3a888691f0caf1f7566f to your computer and use it in GitHub Desktop.
horario_atual
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class eraUnix { | |
public static void main(String[] args) { | |
long totalMilisegundos = System.currentTimeMillis(); | |
//*****************Segundos atual***************** | |
long totalSegundos = totalMilisegundos / 1000; | |
long segundoAtual = totalSegundos % 60; | |
//*****************Minutos atual***************** | |
long totalMinutos = totalSegundos /60; | |
long minutoAtual = totalMinutos % 60; | |
//*****************Horas atual***************** | |
long totalHoras = totalMinutos / 60; | |
long horaAtual = totalHoras % 24; | |
//*****************Horario BRASIL***************** | |
long horaBrasil = horaAtual - 3; | |
System.out.println("\n"+horaBrasil+":"+minutoAtual+":"+segundoAtual); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment