Simply use:
date("d.m.Y H:i:s");
To create a date like this:
30.10.2022 20:17:57
You can create dates in different layouts by changing the letters within the string.
d = day m = month y = year (last two numbers) Y = year (all four numbers)H = hour (24h) h = hour (12h) m = minute s = second
By using the method, the servers clock on which the code is running will provide the time.