How to turn off messaging at night on an iPhone?

So my parents want to take away my phone at night because I don't go to bed at the right time that they want. But I like my phone so I can have music and things to listen to when I sleep. Is there anyways that they can lock my messaging without having to take my phone away all together?

Not possible to turn it off completely with password unless you have a jailbroken iPhone However you can turn on Airplane mode so the cellular service doesn't work but you can still manually activate the Wi-Fi.

If you have iOS 6 and later just enable Do Not Disturb mode, it silences all notifications from ringing and vibrating - kinda the same idea.

Put the iPhone in airplane mode and you won't be able to send or receive any messages at all until you turn it back on.