Example #1
0
File: func.php Project: bas2/diary
$datetoday = date('Y-m-d');
//
$datetimetoday = date('l jS F, Y H:i:s');
// Monday 8th December 2003 16:37:38
//$today_unixh   = d_unixh($datetoday); //
$d_today = date('l jS F, Y');
//
$dt = !isset($gt_dt) ? d_unixh($datetoday) : $gt_dt;
$mkt_dt = strtotime($dt);
$d_sel = @date('l jS F Y', $mkt_dt);
if ($d_sel == $d_today) {
    $d_sel = 'Today';
}
$dt_d = unixh_d($dt);
// $expl_d        = explode('-', $dt_d);
$lastmon = prevmday($dt);
$mkt_lastmon = strtotime($lastmon);
// Are we currently in BST or GMT?
function BSTorGMT($d = '')
{
    // Script obtained from: http://www.devscripts.net/browse/116.php
    // Declare some start variables
    $ThisYear = @date("Y");
    $MarStartDate = "{$ThisYear}-03-25";
    # 25 March.
    $OctStartDate = "{$ThisYear}-10-25";
    # 25 October.
    $MarEndDate = "{$ThisYear}-03-31";
    # 31 March.
    $OctEndDate = "{$ThisYear}-10-31";
    # 31 October.
Example #2
0
function popp($link, $d, $arrD)
{
    $dt_d = prevmday($d);
    # Y-m-d
    $iscurwk = prevmday($dt_d) == prevmday(date('Y-m-d')) ? 1 : 0;
    $str = '';
    // Get info for popups
    for ($i = 0; $i < 7; $i++) {
        $mysqldt_p = date('Y-m-d', strtotime(date('Y-m-d', strtotime($dt_d)) . " +{$i} day"));
        list($dy, $dt, $mnth) = explode(" ", d_format($mysqldt_p, 4));
        // 29/04/15 - Shorten day name to three letters so day and date fits:
        if (strlen($dy . $dt) > 11) {
            $dy = substr($dy, 0, 3);
        }
        // 22/05/09: We use htmlspecialchars() so that the pop display info correctly - Added to get_info() function instead! on 26/05/2009
        $popuptxt2 = '<div class=&quot;date_s&quot;>' . d_format($mysqldt_p) . '<br />[' . days_from_days_to($mysqldt_p) . "]</div><p>" . get_info($link, $mysqldt_p, 400) . '</p>';
        $str .= "-||-<a tooltiptxt=\"{$popuptxt2}\" title3=\"{$mysqldt_p}\" title4=\"" . substr($dy, 0, 3) . "\" iscurwk=\"{$iscurwk}\"" . " class=\"datehead\">{$dy} {$dt}<br />{$mnth}</a>";
        // $str.=  "-||-<a title2=\"$popuptxt2\""
        // . ' class="datehead" onclick="makerequest(\''.TOOLS_SCRIPT.'?act=getday\' '
        // . ", 'dateinfo', '$mysqldt_p', '{$arrD[$i]}', $iscurwk);\">$dy $dt<br />$mnth</a>";
    }
    // End for.
    return $str;
}