Days Left in year Function

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

Features

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

Preview

Days Left in the year -

Downloads

Javascript

<!-- 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 $10/-
  • For customization of this script or any script development, mail to support@hscripts.com

Usage

  • Just copy the code and use it for free.

License

Related Scripts

Free Javascript Scripts


Ask Questions

Ask Question