Proposed by @reitermarkus in https://github.com/Homebrew/brew/pull/1890#discussion_r97210285. I made one slight adjustment of preserving the previous date string in case anything was relying on it.
Homebrew's Formula API
This is the (partially) documented public API for Homebrew.
The main class you should look at is the {Formula} class (and classes linked from there). That's the class that's used to create Homebrew formulae (i.e. package descriptions). Assume anything else you stumble upon is private.
You may also find the Formula Cookbook and Ruby Style Guide helpful in creating formulae.
Good luck!