Set date

Hello, I’ve been searching for several days a solution to set Mac OS X date using an Apple Script app. I’ve found this script, the point is that it is only modifying month and year. Here it is

do shell script "date 11`date +%d%H%M`12" user name "Your Username" password "Your Password" with administrator privileges

11 being the month and 12 the year. Does anybody knows how to change the day too ?
Thank you !

Model: iMac Late 2010, Macbook Pro Mid 2012, Macbook Unibody mid 2010, iPhone 4S, iPad 1
AppleScript: 2.5
Browser: Safari 536.26.17
Operating System: Mac OS X (10.8)

Looking at the man page is often good practice :wink:

Doing that I found :

[b]The command:

   date 0613162785

sets the date to ``June 13, 1985, 4:27 PM’'.[/b]

So I guess that :

do shell script “date 1125date +%d%H%M85” .
would be the correct syntax to set the date to November 25, 1985 at the current time

but honestly, I didn’t tested it because I’m not sure that the code would behave the same on a machine using the French format : ddmmyyyy.

Yvan KOENIG (VALLAURIS, France) dimanche 25 novembre 2012 20:35:30


StefanK wrote in the previous thread:

If you open and type: man systemsteup you’ll get a far easier command to deal with.

then you can make a do shell scriptsystemsetup with the options you like” with administrator privileges

(And thanks for that command Stefan! :slight_smile: )