Reference Global Variable In Function Python Format Datetime As String