get_weekstartend [ WordPress Function ]
get_weekstartend ( $mysqlstring, $start_of_week = '' )
| Parameters: |
|
| Returns: |
|
| Defined at: |
|
Benzer Fonksiyonlar: get_extended, get_last_updated, get_sitestats, get_page_statuses, wp_get_post_parent_id
Get the week start and end from the datetime or date string from mysql.
Source
<?php
function get_weekstartend( $mysqlstring, $start_of_week = '' ) {
$my = substr( $mysqlstring, 0, 4 ); // Mysql string Year
$mm = substr( $mysqlstring, 8, 2 ); // Mysql string Month
$md = substr( $mysqlstring, 5, 2 ); // Mysql string day
$day = mktime( 0, 0, 0, $md, $mm, $my ); // The timestamp for mysqlstring day.
$weekday = date( 'w', $day ); // The day of the week from the timestamp
if ( !is_numeric($start_of_week) )
$start_of_week = get_option( 'start_of_week' );
if ( $weekday < $start_of_week )
$weekday += 7;
$start = $day - 86400 * ( $weekday - $start_of_week ); // The most recent week start day on or before $day
$end = $start + 604799; // $start + 7 days - 1 second
return compact( 'start', 'end' );
}
?>
Examples [ wp-snippets.com ]
Google Arama Sonuçlarý
- Function Reference/get weekstartend « WordPress Codex
Description. Get the week start and end from the MySQL DATETIME or date string . Usage. <?php get_weekstartend( $mysqlstring, $start_of_week ) ?> ...
codex.wordpress.org - Docs for page functions.php
array get_weekstartend (string $mysqlstring, [int $start_of_week = '']). string $ mysqlstring: Date or datetime field type from mysql. int $start_of_week: Optional.
phpdoc.wordpress.org - 常用函数-get_weekstartend() | WordPress啦!
<?php get_weekstartend( $mysqlstring, $start_of_week ) ?> ... get_weekstartend( )位于wp-includes/functions.php中。 ‹ 常用函数-get_user_option() 向上 常用 ...
www.wordpress.la - Docs for page _functions.php
May 20, 2008 ... [ Top ]. get_weekstartend [line 421]. void get_weekstartend( $mysqlstring, $ start_of_week ). Get start and end day of a week, based on week ...
doc.b2evo.net