I was the same. I'm down to about 1/2am now, which is better than 6/7am :s
Try and force yourself to get up at a reasonable hour, and then have a busy day! Shopping, sport, a day out to town, a day at work. Maybe even that studying you need to do! Over a few days, you'll be ever so tired. But it does get you back into a more sociable routine...
Also, try and do what I didn't do and avoid TV and the computer too late. And a small evening meal is better than a huge one.
I'd say at this stage though it's what you do in the daytime that'll help more than your evening routine..
I'd avoid pills if you can, but consider them if changing your routine fails.