<?php
echo "<p>".date("d.m.Y")."</p>";

echo "<p>".date("l d. F Y H:i:s")."</p>";

$jahr = date("Y");
echo $jahr;

echo "<p>".date("H:i")."</p>";

$tag = date("N");
echo "<p>Tagesnummer: $tag</p>";

echo "Zufallszahl: ".rand(1,10);
?>

11.12.2025

Thursday 11. December 2025 23:32:47

2025

23:32

Tagesnummer: 4

Zufallszahl: 4


Datumsausgabe auf Deutsch

<?php
setlocale(LC_TIME, "de_DE");
echo "Heute ist ";
echo strftime("%A");
echo ".";
?>

Der Monats- und Wochentagsname wird entsprechend des per setlocale() eingestellten Wertes gesetzt.

www.php.net/manual/de/function.strftime.php

Heute ist Donnerstag.


setlocale — Setzt Locale Informationen

Beschreibung

string setlocale ( int $category , string $locale [, string $... ] )

string setlocale ( int $category , array $locale )