The simple answer as to why the two pieces of code give different results is that they are written for two different languages. The first is bash which was the default shell on OSX 10.3 up to 10.14. The second is zsh which is the current default shell. (Also the first is not correct code in any language there is a missing PS1 and there should be no spaces around =)
zsh will not read .bash_profile or .profile but just .zshrc
zsh is very well documented at https://zsh.sourceforge.io/ Prompt is documented here
The code given for the second is almost certainly not what you want as the DATE variable is set when the shell starts and you probably want the date and time when the prompt is run.
As a disclaimer I don't like most UNIX shells as the syntax is obscure to me as they were designed to let the user type as few characters as possible so I do not fully understand them so I would use non POSIX shells like fish which allows you to set the prompt from a web interface or understandable functions.
Simple example of the prompt are in the zsh introduction I would start there and build up. There is also zsh prompt generator web site that will allow you to play around with what can be done
However neither of those say anything about colours. For that see the zsh reference This shows that in the prompt %F{white}
makes everything after it have white foreground colour. So you example would show white then green then red then white then yellow then reset to remove all colours.
echo $SHELL
show?export = [/u@h/W]/$
is syntactically not correct, I assume a copy/paste error).