in reply to to print a system command

Hello oikool,

For now, I'm going to assume that you are an admin on your machine since executing date -s ... requires root privileges.

As for your question, you need to properly quote your input: Use qx or other quote like operators in your system function call.

system('date -s "2 June 2020 18:00:00"');

Replies are listed 'Best First'.
Re^2: to print a system command
by Anonymous Monk on Feb 12, 2014 at 13:34 UTC
    Or system("date", "-s", "2 June 2010 18:00:00") which is way better since you don't need to worry about the shell that way.