Getting the current time?

Getting the current time?

by Richard Crawford -
Number of replies: 1
Is there a general function which will return the current time as Moodle sees it?  For example, the server that runs our Moodle installation is located in Florida, but our office is located in California; thus, everything in Moodle is set for PST, and I have a function that needs to check midnight in PST.  If I use the standard PHP time() function, though, it will return EST, not PST.

Any hints?
Average of ratings: -
In reply to Richard Crawford

Re: Getting the current time?

by Dan Stowell -
Look at the functions in lib/moodlelib.php:

userdate()
usertime()
usergetmidnight()
usertimezone()

etc. Not sure which one(s) will fit your task.