6
I can see Linux time from the command line like this:
>date
Qua Mai 25 14:49:58 BRT 2016
But now I need to change the Linux time by the command line, because as I use a Linux server, I only have access via SSH.
How to change the time of Linux from the command line?
Note: I know it is not in the scope of the site to ask questions about operating system, but as it is a problem related to programming posted here. All my systems were on the wrong date because of this, but I was able to solve with the solution given in the answer (Thank you for the answer).
Sorry, I hadn’t read the SSH part. Ignore the removed answer
– João Victor Gomes Moreira
I do not think it is outside the scope, I believed it would be a famous vote for revenge but has just received another -1. It would be a case of resorting to META?
– João Victor Gomes Moreira
@Wallacemaxters didn’t give the -1, but I voted to close, don’t get me wrong, but just because you have the problem, it doesn’t mean that it is in scope (that’s what you implied in the comment). I think the question belongs to the superuser.
– user28595
It was not I who gave -1, however, I voted to close as out of scope, your doubt this more directed the configuration of the system than in something related to programming, if I was wondering how to change the time of the served via shell script would even be valid, maybe here may be a suitable place to ask about terminal commands.
– gato
You might think it was me @Wallace Maxters, but no. I even agree that you should not give an answer without being sure that it can work. I think it’s as legitimate a question as any other
– Miguel
@drmcarvalho this site of the network I didn’t even know, it seems even more indicated that the superuser.
– user28595
@Miguel, by the way, your answer was correct ;)
– João Victor Gomes Moreira
But yours deserves more, more complete and safe mutio. I replied without testing, I wasn’t sure
– Miguel
I still don’t understand why negative points are a question that can help many programmers who manage their servers on Amazon for example. Deserves +1
– Miguel Batista
You can replace the file
/etc/localtime' pelos arquivos da pasta
/usr/share/zoneinfo`, they are responsible for the time zone, (if you want to change only the time)– Brumazzi DB
(Delayed) For most UNIX/Linux commands the option
--help
brings the basic help related to this command. Example:date --help
– Piovezan