Assignment

Assignment

by Thisum Buddhika -
Number of replies: 3
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!!!
Average of ratings: -
In reply to Thisum Buddhika

Re: Assignment

by Mark Johnson -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers
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.
In reply to Thisum Buddhika

Re: Assignment

by Sam Hemelryk -
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.