Jan-05-2017, 12:35 AM
You should use classes. This whole custom date configuration can be a class. Your function would be the classes methods (get_previous_byday and date_to_str) and your global variables would be the classes attributes (weekdays, sun_Datetime, sun_Day, sun_Month, sun_Year). In that way you wouldnt have to use global all over or pass variables back and forth between functions.
Recommended Tutorials: