Returns the given date as a string, formatted according to a pattern. The pattern is a format that is full of various placeholders that will display different parts of the date. These are case-sensitive! These placeholders can be repeated for a different effect. For example, M will give you 1-12, MM will give you 01-12, MMM will give you Jan-Dec, MMMM will give you January-December.
The placeholders are:
Date date - The starting date.
string pattern - The pattern to format the given date to.
string - The given date formatted based on the given format pattern.