My macbook pro shuts off randomly?
So my MacBook Pro has shut itself down twice in the past two days. It shuts off randomly, takes about 45-60 seconds before I can turn it back on, and when I turn back my date and time settings are way off (ie the most recent time it said that it was Monday, November something, 2012, at 4:02 pm, when it was really Wednesday January 21, 2015, and 5:25 pm). I have a frayed charger cable, and it has been plugged in during both shutdowns. I have a new one on its way, but I cannot stop using this one yet, because I am a college student and I need my laptop, and none of my friends/roommates has a MacBook with the proper charger for mine, so I can't use any of theirs. Any explanations?
MacBook Pro (13-inch Mid 2012), OS X Mountain Lion (10.8.5)