The oldest Sanskrit text, the Rigveda, is usually dated to 1500 BC as an oral tradition. It wasn't written down until much later. The oldest surviving unambiguously Sanskrit writing is from 100 BC, using the Brahmi script. It actually isn't the surviving oldest Indic written language either, the Edicts of Ashoka date to 300 BC and are texts written using various scripts and vernacular languages.