Bhagavad Gita 17.22
Chapter 17: The three kinds of faith
अदेशकाले यद्दानमपात्रेभ्यश्च दीयते ।
असत्कृतमवज्ञातं तत्तामसमुदाहृतम् ॥ २२ ॥
That alms given at unfit place and time, and to unworthy persons, disrespectfully and contemptuously, that is declared of darkness.
Sanskrit text and English translation: Annie Besant, The Bhagavad-Gita, 4th edition (1922) — public domain, via Wikisource. Chapter summaries: SamayaVeda.