Something important to note is that melatonin is not going to force you to sleep. You're not going to fall asleep staring at a computer screen if you take a dose of melatonin. It will make you sufficiently tired to sleep if you lie down and close your eyes for a bit, but it's not going to overcome the awareness-brainhack that is staring at bright light.