You will need to specify your actual model phone for us to assist, as there are some models that can enable glance screen, which will keep the date and time visible, along with other notifications.
If you're just wanting to keep a clock on the screen while you sleep, well, there are numerous apps in the store for that.
Night Stand Clock Lite comes to mind.