PHP - Date & Timestamp Snippets: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
Zeile 1: Zeile 1:
 +
== Ein paar Beispiele ==
 +
<syntaxhighlight lang="php">
 +
$today = strtotime(date("Y-m-d"));
 +
</syntaxhighlight>
  
Datum (String) in Timestamp umwandeln
+
 
 +
==Datum (String) in Timestamp umwandeln==
  
 
For recieving page of today, you would have to create a start and end time range and use them in the selector.
 
For recieving page of today, you would have to create a start and end time range and use them in the selector.

Version vom 15. Oktober 2018, 16:22 Uhr

Ein paar Beispiele

$today = strtotime(date("Y-m-d"));


Datum (String) in Timestamp umwandeln

For recieving page of today, you would have to create a start and end time range and use them in the selector.

$start = strtotime( date('Y-m-d') . " 00:00:00");
$end = strtotime( date('Y-m-d') . " 23:59:59");

haven't tested it but should work along these lines