I have been searching for a library in JS where I get the output as date format pattern ('yyyy-mm-dd' or 'dd-mm-yyyy' or so on..) from a date as input. the date could be in string format or UNIX. i.e if we paas date in some dateFormat('2021-08-14') function then output would be yyyy-mm-dd or so on.
If anyone has any idea about this then please let me know I know I can achieve this with regex but I want a build library in JS. Thanks in advance