Lwichi Mululu
Lwichi Mululu

Reputation: 11

Current Datetime in PHP

I can't just make this work.

How can i display the current date in PHP in the format YYYYMMDDHHMMSS.

Regards

Matt

Upvotes: 0

Views: 395

Answers (2)

Dominic Rodger
Dominic Rodger

Reputation: 99751

Use date:

echo date("YmdHis");

That'll display the current date in the format you asked for in the timezone of whatever machine PHP is running on.

Upvotes: 3

Atli
Atli

Reputation: 7930

Try

echo date('YmdHis');

Upvotes: 4

Related Questions