Shiva Purana
आदिसृष्टौ महादेवः सर्वज्ञः करुणाकरः । सर्वलोकोपकारार्थं वारान्कल्पितवान्प्रभुः १२ ।
At the beginning of the first creation, the omniscient, merciful lord Mahādeva created the different week days for the benefit of the entire world.
english translation
AdisRSTau mahAdevaH sarvajJaH karuNAkaraH । sarvalokopakArArthaM vArAnkalpitavAnprabhuH 12 ।
hk transliteration by Sanscript