www.webdeveloper.com
Results 1 to 2 of 2

Thread: Help javascript variable fiscal year?

  1. #1
    Join Date
    Feb 2011
    Posts
    1

    Help javascript variable fiscal year?

    thanks ahead of time for any help...

    I have this code
    <script type="text/javascript">
    var currentTime = new Date()
    var year = currentTime.getFullYear() - 1
    document.write(year)
    </script>
    &amp;
    <script type="text/javascript">
    var currentTime = new Date()
    var year = currentTime.getFullYear()
    document.write(year)
    </script>

    which gives me this 2010 & 2011 but I need it based on a fiscal year that switches it to 2011 & 2012 in June of this year instead of Jan, 1st of next year... Is it possible??? I'm new to javascript so any help would be appreciated...

    Keith

  2. #2
    Join Date
    Mar 2010
    Posts
    2,803
    You can get the current month as well. If the current month is greater than 6, add 1 to the year values.
    Last edited by tirna; 02-10-2011 at 06:43 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles