Posted 04 September 2006 - 02:25 PM
How do I retrieve the server's date and time in the format dd/mm/yyyy?
Posted 04 September 2006 - 03:03 PM
The original script shown below works but it displays elements I am not interested in.
// Get server date
$mydate = date("U"); // date("U"); //
// Get Timezone offset
$myoffs = date("Z") - $myServerOffset;
// Adjust offsets for local machine
//print "var tzoffset = $myoffs + (new Date().getTimezoneOffset()*60);";
print "var tzoffset = $myoffs +(new Date().getTimezoneOffset()*60);";
print "var servertimeOBJ=new Date(($mydate+tzoffset)*1000);";
Posted 04 September 2006 - 03:06 PM
Posted 04 September 2006 - 03:15 PM
Maybe you could clarify that for us.
Posted 04 September 2006 - 03:24 PM
That is what i'm exactly trying to do, sorry for not clarifying things.
Posted 04 September 2006 - 03:29 PM
<?php echo "Today's server date is ". date("Y-m-d"); // or any format you want - check the date() function in the manual ?>
Posted 05 September 2006 - 12:28 PM
Posted 05 September 2006 - 12:32 PM
To put it into an PHP variable then just assign it...
<?php $today = date("Y-m-d"); echo "Today's server date is $today"; ?>
Links: PHP Docs :: RegEx's :: MySQL :: DevGuru :: w3schools
Posted 05 September 2006 - 12:33 PM
Posted 05 September 2006 - 12:35 PM
Posted 05 September 2006 - 03:05 PM
Posted 05 September 2006 - 03:18 PM
Can a included php script have variables posted to it in the same manner.
Posted 05 September 2006 - 03:33 PM
Or am I not understanding what you are asking?
By that do you mean variables in the URL, eg mysite.com/page.php?var=something
When a html page calls a php script it can post variables to that script.
Then in page.php you use $_GET['var'] to get the var variable? If thats the case you can do that. However you'll have to use an absolute path (http://mysqite.com/path/to/file.php) to the file you are including and make sure that the allow_url_fopen direcive is set to on in the php.ini
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users