override a function in global

Is there any solution to override date() function?

I’m trying to modify date() function for call another function every time date() executed in project.

It’s not overriding date, but are you familiar with formatters?


Actually I want to convert Gregorian date to other national calendars like Jalali.I’m looking for an easy solution to convert all dates in the project.

Thanks for attention.