datetime - Get date format like "Y-m-d H:i:s" from a php date -
Does any date know a way to get the string in which the format of the date is?
I ask this because I want to customize this function which I have written, specially without the special timeframe of the time taken from the server.
and Format ($ format); } Print get_timezone_offset ("Europe / Rome"); Print get_timezone_offset ("Europe / Rome", Date ("Y-M-DH: I: S")); Print get_timezone_offset ("Europe / Rome", Date ("Y-M-DH: I: S"), "Y-M-DH: I: S"); Print get_timezone_offset ("Europe / Rome", "2009-10-16 21:30:45", "Y-M-DH: I: S", "America / New York"); ? & Gt;
I hope to avoid regular expression for reasons of execution, but I do not know if it is possible
As far as I know, there is no guarantee of working backwards. The best way to get the expected popular formats (like \ d {2,4} [- /] \ D {2} [- /] \ d {2} for "YMD"), but I have regular expressions Can not think of an easy way to do it without using it. You also need to see that the parsed format is understandable, and you can not do a lot about obscure dates like March 2, 2009, which is
09/03/02
, 2009-03-02
, 02/03/09
, 03/02/09
, or even 09/02 / 03
.
Comments
Post a Comment