whenever I want to use dates on my site, I use the following:
date('Y-m-d H:i:s');
now, I can never remmeber that correctly so I'm always copying and pasting. So I figured, why not make a function. This is what I have, tell me what I'm doing wrong or how to do this plz!
my code:
function makedate($var1)
{
$var1= date('Y-m-d H:i:s');
global $var1;
}
I've also tried:
function makedate()
{
$date1= date('Y-m-d H:i:s');
global $date1;
}
i call this function on a page(either
makedate();
or
makedate($date1);
and then I do a echo $date1;
it displays nothing.
Then i did a !isset check and the variable isn't being set :/
any suggestions?