Turn on/off Portrait Orientation, Depending on the Time of Day Compared to the iPad, the Touch's orientation lock is quite clunky. Oh well, I say. I only use it twice a day, on at 10pm and off at 7am—the time I spend in bed with the little gadget.

But it gets clunky, like I said, and it'd be nice to realize that it's nighttime and I'm likely in bed, drinking water and trying to sleep, and turn on orientation lock.

Is it possible?
This is certainly not possible with the stock software provided by the iOS and I haven't seen any application in the AppStore that does such thing. Should be "relatively" easy to do, but I'm not sure who'd want a software like that (other than you) ;)

EDIT: Now that I think about this, I'm not sure if the API for controlling that is public or private. If the later, then you can't really create an app that "modifies" the Phone's Settings, so my best guess is that you'd be out of luck.