Make date_format() independent of format() method. Should fix #2580