コード例 #1
0
ファイル: example.php プロジェクト: alexander171294/phpquery
        // to set lifetime you need use TIMESTAMP generated by _date class
        $example = new _date();
        // this represents now
        $example->hours(10);
        // now, $example represent now+10 hours
        $example->hours(10)->hours(10);
        // this add 20 hours to count
        // the functions:
        $example->seconds(15)->minutes(25)->hours(21)->days(15)->weeks(2)->months(1)->years(5);
        // if you need the timestamp (in cookie is not necessary call this function)
        var_dump($example->count());
        // if you need show in view format:
        $example->fDay('/')->fMonth('/')->fYear();
        // format year
        // this show DD/MM/YY
        var_dump($example->format());
        // others formats:
        $example->fSecond(':')->fHour(':')->fMinute();
        // ss:hh:ii
        // this show DD/MM/YYss:hh:ii
        var_dump($example->format());
        // if you need space inner YY and ss you add space in fYear()
        // if you need clear format use ->clear()
        // if you need use other timestamp and not current time, use:
        $otherExample = new _date('TIMESTAMP HERE');
    }
});
// massive managment records, and redirects
// we recommend you see the example model before see this controller
_::define_controller('example_4', function () {
    // if you need redirect te code to other controller