Get the App
SLTechnology News&Howtos  ›  Development  › 

How does php convert a date to a delimited date

Shulou Source: shulou.com Published: 2022-06-03 04:11:00 10月05日 Update

This article introduces the relevant knowledge of "how to change the date to the delimited date by php". In the operation of the actual case, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Php changes the date to the delimiter date: 1, create a PHP sample file; 2, convert the specified date into a timestamp through the mktime function; 3, through "date (" Y-m-d ", $newdaystr);" replace the delimiter.

This article operating environment: windows7 system, PHP7.1 version, DELL G3 computer

How does php convert a date to a delimited date?

The php date form delimiter is changed from / to-

For example:

Change 16Universe 2011 to 2011-11-16.

$t_today = "16 Y-m-d 11 t_today 2011"; $daystr=split ("/", $t_today); / / change to a timestamp $newdaystr=mktime. / / change the delimiter echo date ("Y-m-d", $newdaystr); "how to change the date to the delimiter date". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Date delimiter content time more knowledge practicality achievement next function dilemma reality form situation document article method case environment computer Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Microsoft NVidia Shulou Information OPPO Reno