Keine Setup- und Abo-Kosten. Weil diese Funktion nur Integer-Zeitstempel akzeptiert, ist die Formatanweisung u nur nützlich, wenn man die Funktion date_format() mit von Benutzern angegebenen Timestamps aus der Funktion date_create() verwendet. Since this function only accepts integer timestamps the u format character is only useful when using the date _ format () function with user based timestamps created with date _create().
The optional timestamp parameter is an integer Unix timestamp that defaults to the current local time if a timestamp is not given. The required format parameter of the date () function specifies how to format the date (or time).
The PHP strtotime manual here states that The function expects to be given a string containing an English date format. That means that a date provided as Y-m-d may get misinterpreted by strtotime. You should provide the date in the expected format. PHP date() format when inserting into datetime in. PHP - Function date_format() - These functions return date formatted according to given format.
This tutorial uses PHP strtotime() and date () functions to convert date time format. For example you have stored a date YYYY-MM-DD format in a variable and need to change this to MM-DD-YYYY format.
