How to change Linux timetable from the command line?

5

I can see Linux timetable from the command line like this:

 >date 
 Qua Mai 25 14:49:58 BRT 2016

But now I need to change the Linux timezone from the command line because, as I use a Linux server, I only have access via SSH.

How can I change the Linux timetable from the command line?

Note : I know it is not in the scope of the site to ask questions about the operating system, but as this is a problem related to the programming I posted here. All my systems had the wrong date on account of that, but I ended up resolving with the solution given in the answer (Thanks for the reply).

    
asked by anonymous 25.05.2016 / 19:51

1 answer

9

I had made an answer, but it was terminal change, my fault. Good to change by command line in SSH is pretty easy too.

Change time (eg 10 hours and 52 minutes: 10:00:00):

date +%T -s "10:52:00"

Change date (eg October 25, 2016, 6:00 p.m.):

date -s "25 OCT 2016 18:00:00"

And I'll also leave the @Miguel option that posted in an answer shortly, but unfortunately deleted .

Change date and time:

sudo date –s "25 DEZ 2016 15:04:00"

Change time only:

sudo date +%T -s "15:04:00"

Basically sudo works with the command date –set="STRING"

    
25.05.2016 / 19:58