Карта сайта Интеллектуальная поисковая системаДобавить свою ссылку по ключевому запросуПоисковая система v3.kz поможет ускорить индексацию вашего сайта выводит в Топ |
|
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. public string DateTime::format ( string $format ). <?php $date = new DateTime(2015-08-21 15:00:00 EDT) ; $tz_string = $date->getTimezone()->getName() ; $tz = new DateTimeZone($tz_string) ; $date->setTimezone($tz) ; ?> You would think this code should not change $date at all, but it does. It seems like you can create a timezone object like... Datetime value to string in PHP. admin August 6, 2010 No Comment. This one escapes me everytime I need which results to much googling. DateTime to string. P: 31. Experts Exchange > Questions > PHP Convert Date to String. Using php DateTime class it is easy to compute the time in user timezone from UTC, and you dont have to worry about for Daylight Savings Time changes. I recently had to convert some JavaScript code I’d written that used a PHP-style date format string to a .NET DateTime-style date format string. ok, I already researched a lot of site on how can i convert PHP DateTime object to String. I always see "String to DateTime" and not "DateTime to String". PHP DateTime can be echoed, but what i want to process my DateTime with PHP string functions. Описание. string date ( string format [, int timestamp] ). Информация взята v3.kz |
загрузка...
|