MikeLamb
Member
Registered: 23rd Sep 03
Location: Crowthorne Drives: Veccy SRI
User status: Offline
|
i use invision power board on my site and basically i need to make all posts appear to be posted 7 hours later than they actually were (i changed the server time to gmt) the dates are stored in the mysql table like this : msg_date = 1086736621 anyone know how i could easily update them? there are approx 7000 messages so i guess i need a php script to do it??
or anyone know how to convert 1086736621 into a proper date so i can have a bash?
thanks
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
Dunno about converting the date - for some reason it's been encrypted. You need to make a php script with a 'do while' loop in it that opens up every record in the table and converts the date and time into the usual 6 and 4 digit sequences andthen add on 7 hours... Sounds a little complicated now actually
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
In the file that gets the messages from the database and prints them to a page though there will be the script decrypts the date, and in the file that sends the message to the database there will be the script that encrypts it
|
Neil
Member
Registered: 2nd Nov 03
Location: Newcastle Drives: E46 MSport Coupe
User status: Offline
|
thats not encrypted. Its server time. Can't you just adjust the time different in the Admin CP to +7 or whatever u want it?
|
ed
Member
Registered: 10th Sep 03
User status: Offline
|
Server time... Never used that, now I look silly I always use $date()...
|
MikeLamb
Member
Registered: 23rd Sep 03
Location: Crowthorne Drives: Veccy SRI
User status: Offline
|
i always use date too but i knew it was kinda standard! Changing the time in the cpanel only changes the current time and therefore all future times!
The server is in the usa on usa time and although the offset in the cpanel was setup properly so everything looks ok, all the messages were stored in the db as being 7 hours before they actually were! Now there is no offset all the dates are wrong, so i need to figure out what server time actually means
|
James_DT
Member
Registered: 9th Apr 04
Location: Cambridgeshire
User status: Offline
|
It's the time in seconds since January 1st 1970. 1086736621 is 00:17.01 on 09/06/04.
7 hours is 25200 seconds, make a script to retrive each time,add 25200 to it, and insert it back into the row.
|
MikeLamb
Member
Registered: 23rd Sep 03
Location: Crowthorne Drives: Veccy SRI
User status: Offline
|
fantastic thanks soo much
|
Neil
Member
Registered: 2nd Nov 03
Location: Newcastle Drives: E46 MSport Coupe
User status: Offline
|
I meant the forum admin panel, not server
But James' way sounds good
|
MikeLamb
Member
Registered: 23rd Sep 03
Location: Crowthorne Drives: Veccy SRI
User status: Offline
|
i meant forum admin panel too thanks guys
|
James_DT
Member
Registered: 9th Apr 04
Location: Cambridgeshire
User status: Offline
|
Nae worries mate.
|