I have exactly the same problem.
Here's what works:
- Get up at the same time each day, say 8am.
- Don't drink coffee or tea after a certain time, say 6 pm.
- Go to bed at the same time each day, say midnight.
- Get away from the computer at least a full hour before you plan to go to bed at night.
- Every morning when you get up, take a walk outside for ~30 minutes. You need the sunlight to let your body know it's time to be awake.
- Eat at regular times.
- Make sure you get enough exercise every day, preferably fairly early in the day.
Essentially, you want to rebuild your biological clock.
Of course, without external influences (like a 9-5 job) it requires a hell of a lot of willpower, something that very few people have.