I use Taskers built in Custom Settings. For Pixel and possibly most AOSP ROMs it's status_bar_clock. 1 to enable and 0 to disable. Some manufacturers and software may change the name for the status bar clock. You may have to do experiments to figure it out. Autotools has a nice way to figure out some custom settings too if you need help with them.