Need to calculate the shift number based on a past event datetime tag

Thanks for explainging the YYYY vs yyyy. If I use yyyy then the format result breaks, Using YYYY the format result is as desired.
For example Using YYYY

Using yyyy How do I resolve the resulting format error?

I would also love to do it without the submit button but I think I'm binding wrong or something. I have the datetimeinput.value bidirectionally tied to my prod_datetime tag. (which is also a datetime tag as suggested earlier. This tag is not a "now" timestamp but a chosen time in history.

I can't tell you all how grateful I am for the support.