PDA

View Full Version : vBulletin PHP to Perl? (read if you know PHP and Perl ^_^)


Colin-FON
Tue 31st Oct '00, 4:52pm
Hey again everyone. I posted a few days ago about importing the vB info into the SQL database through a Perl form, and got some great help on getting the field numbers, now I am at the second little problem.

vB uses a special date format which the members.php file (and maybe others) contains the code for. I don't know a word of PHP, so I can see it, but I have no idea how it works. I'm trying to write an operation in perl that will submit the date/time to the SQL database in the same fasion as the vB PHP does, but I don't know perl that well either hehe.

Is there anyone out there who understands both languages that could convert the PHP into Perl for this date/time function, and then let me know how to do it?

Thanks for taking the time to read this!

Mike Sullivan
Tue 31st Oct '00, 4:55pm
I think time() works in Perl too. I forget.
The "special code" is just a unix timestamp anyway.

Colin-FON
Tue 31st Oct '00, 5:29pm
Sorry Ed, you are right about the time, I confused myself heh. My question was on the date, specifically the joindate field in MySQL. vB changes the joindate into a figure like 972883301 (value inserted for records created on 10/30/2000) when it enters it into the mySQL field, and I would like to know how I could do that in perl. I don't really understand the PHP operation that changes a date into that 9 digit number, but leaving the field NULL in my perl submission page causes a value of 0 to be entered in the joindate field.

Any help is greatly appreciated!

Chris Schreiber
Tue 31st Oct '00, 8:05pm
That number (972883301) is Unix Epoch time... basically the number of seconds that have elapsed since midnight, Jan 1, 1970. Sorry but I'm not sure how you get that number in Perl though.

-Chris

Colin-FON
Tue 31st Oct '00, 10:28pm
Thank you! That's what I needed to know! Epoch time in Perl is no problem, simply "time".
Thank god the vB designers chose to import the time in seconds and then convert when PULLING from the database...that saves me from having to write my own conversion function...I LOVE VB ^_^