Hello,
I'm new here and I need some help.
I need get the current time, but using the date("Hi") function get one hour less. (at 12:00 I get 11:00)
I have the same problem with the chat module and I setup the timezone of my country and work fine.
Maybe I must use another date function to apply the timezone? What function it's used on the chat module to show the time? I don't find it.
Thank you very much
Jorge
$time = time(); // this will get you the current time in unix time format (seconds since 1/1/1970 GMT)
echo userdate($time, '%H:%M'); // this will print the time in the timezone of the current user (formats)
echo userdate($time, '%H:%M'); // this will print the time in the timezone of the current user (formats)
Hello,
Does somebody know how to get the current day and month on Moodle?
Cheers,
Vitor
Does somebody know how to get the current day and month on Moodle?
Cheers,
Vitor
You could try these clock blocks.
Thank you Martin, this was what I need.
Hello Martin,
Do you know any Moodle function to give the current day and month?
Looking forward for an answer.
Peace,
Vitor
Do you know any Moodle function to give the current day and month?
Looking forward for an answer.
Peace,
Vitor
Hello Vitor,
Is there a particular reason you need to use a Moodle function? PHP has excellent date and time functions built-in (although it can take a while to get familiar with them). The date() function is very flexible, for example.
However, if you need the Moodle timezone, then the Moodle userdate() function already mentioned is ideal. The format string is the same as for PHP's strftime() function.
-Peter
Is there a particular reason you need to use a Moodle function? PHP has excellent date and time functions built-in (although it can take a while to get familiar with them). The date() function is very flexible, for example.
However, if you need the Moodle timezone, then the Moodle userdate() function already mentioned is ideal. The format string is the same as for PHP's strftime() function.
-Peter
Hello everyone,
I am new to php programming.Can we create a block on moodle which would display "good morning", "good evening" messages based on user's time.
Please help.
-Shreyas
I think that would be another fairly simple thing to do using the Generico filter. I've been using it for a year or so to personalize greetings and other messages to students throughout the various courses and parts of Moodle. Go to this forum discussion and ask: https://moodle.org/mod/forum/discuss.php?d=324771#p1335240