Function to convert PHP date format to Javascript date format (not the date itself !)
问题 I am looking for easy way to convert PHP date format (i.e. Y-m-d H:i:s) to javascript date format (respectively YYYY-mm-dd HH:mm:ss). I don't want to convert the date (there are already answers for this question), I am looking for tool/function to convert the format code (which I don't know yet, as it is defined by the user in application). User can define it in different ways defined by PHP date() i.e. 'Y/m/d H:i' or 'Y-d-m H-i' and I need to use the same format when displaying date in