Date-Time is read from external resource and stored in $dt, And it could be in any valid PHP Date-Time format (valid means date-time is already formated by a string containing letters described here on php.net manual).
What I need to do is to get format of the date-time string, So after manipulating the date to system needs, I can reformat it to the same string and store it in database. Simply put: do opposite of DateTime::format method
Is there any particular method which extracts ‘format string’ of a formated date-time? or an available code?
It is not possible, as the formatted dates can not contain enough information. You will have to write some set of regexp to match your formats which are really used as your inputs – one by one.