T4VN is an online PHP Help community that provides PHP Tutorials, PHP Examples, PHP Scripts, PHP Support
    HOME  |  HOSTING COUPON  |  TEMPLATE  |  PHP SCRIPTS  |  LINK TO US  |  LINK  |  REGISTER | CONTACT
::: Member Login :::
 Username
 Password
 
Forgot your password ?
::: PHP Tutotal :::
  PHP Basic (7)
  PHP Advanced (4)
  PHP Database (2)
  Coding Step By Step (8)
  PHP and AJAX (0)
::: PHP Example :::
  Arrays (1)
  Code Highlighters (3)
  Database Functions (12)
  Date & Time (5)
  E-Mail (6)
  Forms (5)
  Guestbooks (1)
  Logging (2)
  Miscellaneous (10)
  Password Generators (3)
  Randomizers (3)
  String Manipulation (10)
  User Authentication (6)
::: Search On T4VN :::
::: T4VN Statistics :::
  PHP Scripts : 61
  PHP Example : 67
  PHP Tutorials : 21
  PHP News : 93
  Total Coupon : 36
  Other Tutorials :
  Member : 209
  Visitor Online : 1
  Today Visit: 392
  Total Visitor : 262402
  Most Online : 31
::: Sponsored Links :::

PR 4 For This Webpage
Home Today :

Getting the day of the year

Author : sploit

use this function (usage example given in code) to get the day of the year on a specified date. date is specified by giving the day, month and year.

PHP Example :

<?
/* 
Aug 15th, 2003
sploit
*/

/* specify date. d = day, m = month, y = year */

$d 2;
$m 2;
$y 2000;

/* display date and day of the year (on that date) */

if(day_of_year($m$d$y))
{
    echo 
"date: "date("d-M-Y"mktime(0,0,0$m$d$y));
    echo 
"<BR>day of the year: "day_of_year($m$d$y);
}
else
{
    echo 
'invalid date!';
}


/*
FUNCTION: day_of_year($month_number, $day_number, $four_digit_year) 
if date specified is correct, returns the day of the year
else returns false
*/

function day_of_year($m$d$y)
{
    
    if(
checkdate($m$d$y)!=true)
    {
        return 
false;
    }

    for(
$i=$i $m$i++)
    {
        
$timestamp mktime (0,0,0,$i,1,$y);
        
$num_days_in_month date("t"$timestamp);
        
$day_of_year $day_of_year $num_days_in_month;
    }

    
$day_of_year $day_of_year $d;

    return(
$day_of_year);
}

?>


Other Example
Display Future Dates
Simple Calendar
Time Convert Function
Date Convert Function


::: Resources :::
  Links Directory
  Programming 2 3
  Webmaster 2 3
  Web Design 2 3
  Web Hosting 2 3
  Other Links 2 3
  Asian ShowBiz News
  Teach Seo For You
::: New Templates :::




::: Other Tutorials :::
 Program Design

  Powered By T4VN.NET - Version 2.0 - CopyRight © T4VN.NET 2005-2007