The "Do Not Disturb" mode on the new HTC One M8 lets you block all notifications (including incoming calls, new messages, mails) at specific times.
To setup the "Do Not Disturb" mode on the new HTC One M8, do as follows:
1. Open Settings application and go to Sound.
2. Under General settings, open Do not disturb.
3. First, make sure to enable the mode by turning it on
4. Use the Timer option to automatically turn off Do Not Disturb (Choose Manually to manually disable the mode)
5. Use the Exceptions option and add the contacts you'd like to receive notifications from, even on the Do Not Disturb mode.
6. Use the Schedule option to automatically turn Do not Disturb on/off at specific times