corsasport.co.uk
 

Corsa Sport » Message Board » Off Day » php users :)


New Topic

New Poll
  Subscribe | Add to Favourites

You are not logged in and may not post or reply to messages. Please log in or create a new account or mail us about fixing an existing one - register@corsasport.co.uk

There are also many more features available when you are logged in such as private messages, buddy list, location services, post search and more.


Author php users :)
MikeLamb
Member

Registered: 23rd Sep 03
Location: Crowthorne Drives: Veccy SRI
User status: Offline
14th Oct 04 at 21:19   View User's Profile U2U Member Reply With Quote

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
14th Oct 04 at 21:24   View User's Profile U2U Member Reply With Quote

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
14th Oct 04 at 21:26   View User's Profile U2U Member Reply With Quote

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
14th Oct 04 at 21:31   View User's Profile U2U Member Reply With Quote

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
14th Oct 04 at 21:36   View User's Profile U2U Member Reply With Quote

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
14th Oct 04 at 21:41   View User's Profile U2U Member Reply With Quote

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
14th Oct 04 at 21:55   View User's Profile U2U Member Reply With Quote

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
14th Oct 04 at 21:56   View User's Profile U2U Member Reply With Quote

fantastic thanks soo much
Neil
Member

Registered: 2nd Nov 03
Location: Newcastle Drives: E46 MSport Coupe
User status: Offline
14th Oct 04 at 22:03   View User's Profile U2U Member Reply With Quote

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
14th Oct 04 at 22:04   View User's Profile U2U Member Reply With Quote

i meant forum admin panel too thanks guys
James_DT
Member

Registered: 9th Apr 04
Location: Cambridgeshire
User status: Offline
14th Oct 04 at 22:07   View User's Profile U2U Member Reply With Quote

Nae worries mate.

 
New Topic

New Poll

Corsa Sport » Message Board » Off Day » php users :) 22 database queries in 0.0129061 seconds