PHP - Date & Timestamp Snippets: Unterschied zwischen den Versionen

Aus Wikizone
Wechseln zu: Navigation, Suche
(Die Seite wurde neu angelegt: „ 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. <syntaxh…“)
 
Zeile 3: Zeile 3:
  
 
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.
 +
 
<syntaxhighlight lang="php">
 
<syntaxhighlight lang="php">
 
$start = strtotime( date('Y-m-d') . " 00:00:00");
 
$start = strtotime( date('Y-m-d') . " 00:00:00");
 
$end = strtotime( date('Y-m-d') . " 23:59:59");
 
$end = strtotime( date('Y-m-d') . " 23:59:59");
</syntaxhighlight
+
</syntaxhighlight>
 
haven't tested it but should work along these lines
 
haven't tested it but should work along these lines

Version vom 15. Oktober 2018, 16:17 Uhr

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