I have a PHP variable which is a date format string, it is "Y-m-d" but could be other date format strings, I'd like to pass this to a script which requires a JS date format string.
Therefore my Y-m-d from PHP is the equivalent of YYYY-MM-DD in JS.
What can I do on either the PHP or JS side to convert the PHP based date format string of Y-m-d to the JS equivalent?
I am looking to convert the date format string itself, not the actual date.