i have this code:
the time() part returns the time for America (i think thats the server time).PHP Code:strftime("%d/%m/%y %H:%M",time())
Could anybody please provide a way of making the time() part return the time for london?
thanks![]()
i have this code:
the time() part returns the time for America (i think thats the server time).PHP Code:strftime("%d/%m/%y %H:%M",time())
Could anybody please provide a way of making the time() part return the time for london?
thanks![]()
In PHP5:Code:date_create('now', new DateTimeZone('BST'))->format("d-m-Y G:i");
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
could it be in: PHP, PHP3, and PHTML scripts?
as the sever only supports them...
Last edited by lankinator; 07-16-2007 at 05:57 AM.
As long as the server has PHP 5+ installed, it can be whatever extension you want to make it (as long as it is parsed as a PHP script).
"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design
could it be in: PHP, PHP3, and PHTML scripts?
as the sever only supports them...
So basically you're saying PHP5 is not installed on your server...
Thou com'st in such a questionable shape
Hamlet, Act 1, Scene 4
That's fine, the .php extension will handle it (it's probably PHP4).
Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!
The extension of a PHP script doesn't in any way define the version of PHP in use: PHP 5 can quite easily parse a file ending ".php3".
If you want to be useful, actually state what version of PHP your host uses. This information is normally available in the response headers. This can also be found in the document generated by the phpinfo function, and from the phpversion function.
Mike
i stated there that it only has php3, php, phtml installedas the sever only supports them...![]()
twey, i get the following error:
[b]Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in \\192.168.0.16\webfiles\files\2007-1\1253297\user_pages\user.php on line 1[/b[
No, you stated what file extensions will effect parsing as PHP on your server. That has no bearing on what version of PHP is installed.
This is due to the failings of PHP as a language: the DateTime object needs to be assigned to a variable before one of its methods can be called.twey, i get the following error:
Parse error: parse error, unexpected T_OBJECT_OPERATOR, expecting ',' or ';' in \\192.168.0.16\webfiles\files\2007-1\1253297\user_pages\user.php on line 1
PHP Code:$date = new DateTime('now', new DateTimeZone('BST'));
echo $date->format('d-m-Y G:i');
Mike
Bookmarks