Mon Mar 12 10:18:26 +0800 2012 时间格式转换解决方法
Jun 13, 2016 am 10:15 AM
Mon Mar 12 10:18:26 +0800 2012 时间格式转换
上面的是个字符串,怎么把那个时间转换成2012-3-12 10:18:26格式 ,用php写的,谢谢啦
------解决方案--------------------
$s='Mon Mar 12 10:18:26 +0800 2012';
echo date('Y-m-d H:i:s',strtotime($s));
------解决方案--------------------
好像可以直接用date转吧,忘记了
$str='Mon Mar 12 10:18:26 +0800 2012';
echo date('Y-m-d G:i:s',strtotime($str));
------解决方案--------------------
------解决方案--------------------

Hot Article

Hot tools Tags

Hot Article

Hot Article Tags

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

How to create and name a file/folder based on current timestamp

PHP Warning: date() expects parameter 2 to be long, string given solution

Five selected Go language open source projects to take you to explore the technology world

Go language development essentials: 5 popular framework recommendations

Introduction to methods and usage of using Date and SimpleDateFormat classes to process time in Java

What are the options for calendar and date libraries in Python?

Implementing distributed task scheduling using Golang's web framework Echo framework

Laravel development: How to implement WebSockets communication using Laravel Echo and Pusher?
