Jump to content

Change system time


duarteharris

Recommended Posts

Hello.

 

I've been looking for a workflow that changes the system date, but couldn't find one.

 

Does anyone know of one or how to make it?

 

Thank you and take care,

 

Hi there, Could you please fill in your Powerpack email address in your forum profile before discussing workflows and other Powerpack-only features? :)

 

Cheers,

Vero

 

[Edit: Thanks for filling in your details]

Link to post

You'll have to use the Bash command `systemsetup`

systemsetup Help Information
-------------------------------------
Usage: systemsetup -getdate
	Display current date.

Usage: systemsetup -setdate <mm:dd:yy>
	Set current date to <mm:dd:yy>.

Usage: systemsetup -gettime
	Display current time.

Usage: systemsetup -settime <hh:mm:ss>
	Set current time to <hh:mm:ss>.

Usage: systemsetup -gettimezone
	Display current time zone.

Usage: systemsetup -settimezone <timezone>
	Set current time zone to <timezone>. Use "-listtimezones" to list time zones.

If you read through this thread at the Adobe forums, then you'll see some examples of AppleScript. Because the command needs an administrator's password (sudo access), you'll probably have to do something like:

set _month to 12
set _day to 12
set _year to 12
set myScript to "systemsetup setdate " & _month & ":" & _day & ":" & _year
do shell script myScript with Administrator privileges

Obviously, you'll want to set the variables dynamically because that script will just set your system date to 12 Dec 2012. But, I haven't tested it, and screwing around my the date on my system is going to make so many programs throw so many fits that I don't really want to test it, so I leave you here on your own.

 

Be careful about breaking things.

Link to post

For breaking things? Well, so many different aspects of the system rely on the system time. If you use Time Machine, then it might go crazy. Many different synchronization tools might behave unexpectedly. Things might get recorded at the wrong times, having a weird effect on other things later, after you reset the system.

 

Basically, system time is a fairly important part of many programs, and messing with it might achieve unknown effects. It probably won't crash any programs or anything like that, but it is likely to corrupt data. Not corrupt in an "unreadable" way, but corrupt in a "that's just wrong" sort of way. There are just too many variables to predict, and it is likely to break things.

Link to post

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...