Yahoo Poland Wyszukiwanie w Internecie

Search results

  1. 13 maj 2012 · You can use the format method of the DateTime class: $date = new DateTime('2000-01-01'); $result = $date->format('Y-m-d H:i:s'); If format fails for some reason, it will return FALSE. In some applications, it might make sense to handle the failing case: if ($result) { echo $result; } else { // format failed echo "Unknown Time"; }

  2. date_parse () parses the given datetime string according to the same rules as strtotime () and DateTimeImmutable::__construct (). Instead of returning a Unix timestamp (with strtotime ()) or a DateTimeImmutable object (with DateTimeImmutable::__construct ()), it returns an associative array with the information that it could detect in the given ...

  3. If you wish to manipulate with the DateTime object in PHP, then this snippet is for you. Here, you will learn how to correctly convert DateTime to string.

  4. 2 lut 2024 · Different ways of converting DateTime to string using PHP functions, like Using format() of DateTime class, using date_format() method.

  5. 16 sty 2023 · This article demonstrates how to convert a DateTime object to a string in PHP. You can use the format() function of the DateTime class to convert a DateTime object to string in PHP. The DateTime::format function returns the date formatted according to the given format.

  6. 31 lip 2022 · You can represent an exact date and time in PHP using the built-in DateTime object. Creating one is simple, just pass it a string in the format YYYY-MM-DD HH:MM:SS. The problem is that sometimes you want to go from a DateTime object back to a string. In this post, we'll learn how to convert a DateTime object to a string in PHP.

  7. 20 sie 2024 · The date () function in PHP can be used to format a timestamp into a human-readable string. By using the getTimestamp () method of the DateTime object, you can get the Unix timestamp and then format it with the date () function.

  1. Ludzie szukają również