Moodle Date Format

Posted: July 10, 2012 in Uncategorized
Tags: , ,

For our Moodle site, I had to add custom user profile date field called starting date. I was using Moodle’s  upload user utility to load user data through csv file and it wouldn’t load the date correctly. After struggling for four days, I found out that Moodle loads date in unix time or epoch time. I used following formula to convert date in mm/dd/yyyy format to Moodle date format
Moodle date =((date -25569) * 86400) + 21600

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s