Change certificate Date format

Change certificate Date format

by Whitney Lowe -
Number of replies: 7

I need to change the certificate date format so it can be sorted in an Excel file. Currently the date outputs like:

Wednesday, 19 November 2014, 7:10 AM


Is there a way to change the output format so it can be sorted by completion date in a format more like this:

November 19, 2014


Thanks,

Whitney

Average of ratings: -
In reply to Whitney Lowe

Re: Change certificate Date format

by Steven Swanson -

when you put a certificate module in a course, it is one of the options under the "text options". If you don't see that option, then maybe you need to upgrade to a newer version of the plugin.

In reply to Steven Swanson

Re: Change certificate Date format

by Whitney Lowe -

Yes, this seems a little misleading. When the date format is selected in the certificate module it says display in this format:

January 1, 2000

That is also the format that it prints out on the certificates. However, when I generate a report of completed certificates the format looks like this: 
Wednesday, 19 November 2014, 7:10 AM

I am trying to get the date format changed in the report format, not the way it prints on the certificate. 




In reply to Whitney Lowe

Re: Change certificate Date format

by Steven Swanson -

Describe how you are running your reports? That would let me know how to help you.

Are you using an sql report? (if so you can change the date in SQL)

Are you using an admin report?

In reply to Steven Swanson

Re: Change certificate Date format

by Whitney Lowe -

We are looking to generate a report of everyone that has completed the course by generating their certificate. Here's how I get that report:

Click on the certificate activity and it lets me view all the certificates that have been generated. At the bottom of the screen is the option to export the information to Excel, or txt format. I output the information from that screen and then attempt to convert it into a sortable format in the spreadsheet and that is where it is giving that date format I can't work with.

I am not using an admin report because I haven't found one that provides the completion information for the certificates generated.


In reply to Whitney Lowe

Re: Change certificate Date format

by Steven Swanson -

okay, took me a little bit to figure it out, but here it is:


go to the server file

1.)path/to/moodle/mod/certificate/report.php


2.)in the report.php file there is a line that looks like this:


            $myxls->write_string($row, 4, userdate($user->timecreated));


3.)Change it to
            $myxls->write_string($row, 4, date("F d, Y", $user->timecreated));


That will give you February 10, 2015. If you want a different format change the "F" "d" and "Y" to a different format. For a list of formats go to this website -->http://php.net/manual/en/function.date.php

In reply to Steven Swanson

Re: Change certificate Date format

by Whitney Lowe -

Thanks very much. I will certainly give that a try!


Whitney