Results 1 to 2 of 2

Thread: date problems in javascript[resolved]

Threaded View

  1. #1

    Thread Starter
    Hyperactive Member thebloke's Avatar
    Join Date
    May 2003
    Posts
    358

    Resolved date problems in javascript[resolved]

    Hmm, here's a thing.

    I have a date which is passed in a form (dd/mm/yyyy). I need to compare this to today's date using javascript.

    Code:
    <script language="javascript">
    function somefunction()
    {
    var renewdate = document.frm.renewdate.value;
    var today = new Date()
    
    renewdte = Date.parse(renewdate)
    todaysdte = Date.parse(today)
    thedate = today.getDay();
    
    if (renewdte < todaysdte)
    {
    alert("The date of your renewal has passed");
    return false;
    } 
    }
    </script>
    Now, this works on my development machine but not on my live web server. I have

    Code:
    <%setLocale(2057)%>
    In the page that contains the form but the live web server is taking the renewal date 01/10/2005 in the US format 10/01/2005.

    And it's proper doing my head in!

    Any clues?
    Last edited by thebloke; Sep 22nd, 2005 at 10:02 AM. Reason: resolved
    The Bloke
    www.blokeinthekitchen.com
    making cooking cool for blokes

Posting Permissions

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



Click Here to Expand Forum to Full Width