snipt

Ctrl+h for KB shortcuts

PHP

PHP: Get timestamp First day of the month (or last)

1
2
3
4
<?php

$tsFirstDayOfMonth = strtotime('first day of '.date('F Y'));
$tsLastDayOfMonth  = strtotime('last day of '.date('F Y'));
https://snipt.net/embed/fd5716b81a211fef6b91201bf874aa94/
/raw/fd5716b81a211fef6b91201bf874aa94/
fd5716b81a211fef6b91201bf874aa94
php
PHP
4
2016-12-28T21:12:39
True
False
True
Nov 19, 2012 at 10:38 AM
/api/public/snipt/50461/
php-get-timestamp-first-day-of-the-month-or-last
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="cp">&lt;?php</span> </span><span id="L-2"><a name="L-2"></a> </span><span id="L-3"><a name="L-3"></a><span class="nv">$tsFirstDayOfMonth</span> <span class="o">=</span> <span class="nb">strtotime</span><span class="p">(</span><span class="s1">&#39;first day of &#39;</span><span class="o">.</span><span class="nb">date</span><span class="p">(</span><span class="s1">&#39;F Y&#39;</span><span class="p">));</span> </span><span id="L-4"><a name="L-4"></a><span class="nv">$tsLastDayOfMonth</span> <span class="o">=</span> <span class="nb">strtotime</span><span class="p">(</span><span class="s1">&#39;last day of &#39;</span><span class="o">.</span><span class="nb">date</span><span class="p">(</span><span class="s1">&#39;F Y&#39;</span><span class="p">));</span> </span></pre></div> </td></tr></table>
date, php, timestamp

CSS

Symfony 1.x : Style auto on sfWidgetFormDate rendering

1
2
3
4
5
select[name$="[day]"],
select[name$="[month]"],
select[name$="[year]"] {
    width: 70px;
}
https://snipt.net/embed/adc6c153366a65612fb199a73d545a95/
/raw/adc6c153366a65612fb199a73d545a95/
adc6c153366a65612fb199a73d545a95
css
CSS
5
2016-12-29T19:11:45
True
False
True
Sep 16, 2012 at 09:49 AM
/api/public/snipt/47249/
symfony-1x-style-auto-on-sfwidgetformdate-rendering
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a> <a href="#L-4">4</a> <a href="#L-5">5</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="nt">select</span><span class="o">[</span><span class="nt">name</span><span class="o">$=</span><span class="s2">&quot;[day]&quot;</span><span class="o">],</span> </span><span id="L-2"><a name="L-2"></a><span class="nt">select</span><span class="o">[</span><span class="nt">name</span><span class="o">$=</span><span class="s2">&quot;[month]&quot;</span><span class="o">],</span> </span><span id="L-3"><a name="L-3"></a><span class="nt">select</span><span class="o">[</span><span class="nt">name</span><span class="o">$=</span><span class="s2">&quot;[year]&quot;</span><span class="o">]</span> <span class="p">{</span> </span><span id="L-4"><a name="L-4"></a> <span class="nb">width</span><span class="o">:</span> <span class="m">70px</span><span class="p">;</span> </span><span id="L-5"><a name="L-5"></a><span class="p">}</span> </span></pre></div> </td></tr></table>
Symfony, css, date