Note that there are some explanatory texts on larger screens.

plurals
  1. POstrtotime days of the week not displaying in french
    primarykey
    data
    text
    <p>My code will not output days of the week in French. Note: I have also tried to translate the days of the week within the code with the same results (output in English only).</p> <pre><code>date_default_timezone_set('America/New_York'); setlocale (LC_TIME, 'fr_FR.utf8','fra'); $today = strtotime('Saturday 14:00'); $tomorrow = strtotime('Saturday 14:00'); $friday = strtotime('Friday 14:00'); $sunday = strtotime('Sunday 24:00'); $now = time(); if($now &lt; $friday &amp;&amp; $now &gt; $sunday) { $timeLeft = ($now &gt; $today ? $tomorrow : $today) - $now; $hoursLeft = gmdate("G", $timeLeft); $minutesLeft = gmdate("i", $timeLeft); $secondsLeft = gmdate("s", $timeLeft); if($hoursLeft &gt; 0) { echo $hoursLeft . ' heur'; if($minutesLeft &gt; 0) { echo ' et ' . $minutesLeft . ' minutes'; } } else { echo $minutesLeft . ' minutes et ' . $secondsLeft . ' seconde '; } } else $date = date("l\, F j", strtotime("tomorrow")); $day = date('l', strtotime('today')); if ($day == 'Friday') { if($now &gt; strtotime('Friday 14:00')) { echo date('l, F j', strtotime('Tuesday')); } elseif($now &lt; strtotime('Friday 14:00')) { echo date('l, F j', strtotime('Monday')); } } elseif ($day == 'Saturday' || $day == 'Sunday') { echo date('l, F j', strtotime('Tuesday')); } </code></pre> <p>However if I use this basic code on it's own outside of the above it displays properly:</p> <pre><code>setlocale (LC_TIME, 'fr_FR.utf8','fra'); echo (strftime("%A %d %B")); </code></pre> <p>How do I get the first block to output in French only?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload