Get the App
SLTechnology News&Howtos  ›  Development  › 

How to get a simple date in php

Shulou Source: shulou.com Published: 2022-06-01 03:29:12 09月22日 Update

This article is about how to get a simple date in php. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.

Get a simple date

The format parameters of the date () function are required, and they specify how the date or time is formatted.

Some characters commonly used in dates are listed below:

D-represents a day of the month (01-31)

M-represents month (01-12)

Y-represents year (four digits)

1-indicates a day of the week

Other characters, such as "/", "." Or "-" can also be inserted into characters to add other formats.

The following example formats today's date in three different ways:

Example

Thank you for reading! This is the end of this article on "how to get a simple date in php". I hope the above content can be of some help to you, so that you can learn more knowledge. if you think the article is good, you can share it for more people to see!

Tags: Date format character content more article different good practical digit example function parameter instance article method time see knowledge face Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Technology macOS MySQL MariaDB OPPO Reno