JavaScript Scripts





Español Français 中文 Deutsch Portuguese Japanese nederlands
   
 
Free Java Script Codes
Javascript List All
Slide Show Slide Show
Ad Display Ad Display
Image Effect Image Effect
Animated Image Effects Animated Image Effects
Form Validation Form Validation
Color Picker Tool Color Picker Tool
Formatting Forms Formatting Forms
Select All Select All
Dynamic Form Select Dynamic Form select
Dynamic Color Dynamic Color
Calendar Script Calendar
Textbox Counter Textbox Counter
Alphanumeric Alphanumeric
Date Time Script Date & Time
Stop Watch Script Stop Watch script
Delete Repeated Values Delete Repeated Values
Pagination Pagination
Random Generator Random Generator
Animated Text Animated Text
Cursor Position Cursor Position
User Info Window / User Info
Security Security / Authenticate
Bookmark Bookmark
Mouse Effects Mouse Effects
Title Bar Title Bar
Status Bar Status Bar
Country List Country List
Free Games Free Games
Calculators Calculators
 




Days Left in year Function


About
This script function will help you to get days left in the year.


Features
a)The javascript function will return the days left in current year.
b)The function takes date value as argument and returns the days left in that year.
c)Just copy the code in to your page and use it.

Preview
Days Left in the year -


Code
<!-- Script by hscripts.com -->
<script type="text/javascript">
function daysleftinyear(date1)
{
var year = date1.getFullYear();
var date2 = new Date(year,11,31);
var diff = Date.UTC(date2.getYear(),date2.getMonth(),date2.getDate(),0,0,0)
    - Date.UTC(date1.getYear(),date1.getMonth(),date1.getDate(),0,0,0);

var daysleft = diff/1000/60/60/24;

return daysleft;
}
document.write(daysleftinyear(new Date()));
</script>
<!-- Script by hscripts.com -->

Release Date - 5-2-2005
Get free version without ©copyright link for just 5 price

For customization of this script or any script development, contact us at support@hscripts.com


Usage
Just copy the code and use it for free.



License
- The javascript (misspelled as java script) is given under GPL License
- i.e. Free use for those who use the codes as it is.
- Free, if your modification does not remove our copyright information and links.
- Click Here for detailed license information.
- You can purchase the script if your requirements does not meet our GPL License terms.
Other Links

web hosting