in my project i want to get the due date of a given assignment. i tried to do it by querying the database. but the format is a problem as it gives something like 12*******.
can anyone please suggest a way to do this task!!!
You're doing the right thing - the date you're getting is the due date as a Unix Timestamp (i.e. the number of seconds since the Unix Epoch at midnight 1/1/1970).
There are various ways of formatting it into a human-readable form, but the most portable is probably PHP's date() function.
There are various ways of formatting it into a human-readable form, but the most portable is probably PHP's date() function.
If your project is within Moodle you could also use userdate()
It is a function that exists within lib/moodlelib.php and is used to format many of the timestamps used in Moodle.
It is a function that exists within lib/moodlelib.php and is used to format many of the timestamps used in Moodle.
thanks for the info!!