Jump to content

neonardo

WFG Retired
  • Posts

    176
  • Joined

  • Last visited

Posts posted by neonardo

  1. EDIT:

    I got this code but some reason I can't get it right like this: Date: 8/2/2008 - Time: 10:08:34

    But remember time must have 24hr time and not with am/pm.

    So if some one can help me with this am very grateful.

    <h4>Date:

    <script type="text/javascript">

    <!--

    var currentTime = new Date()

    var day = currentTime.getDate()

    var month = currentTime.getMonth() + 1

    var year = currentTime.getFullYear()

    document.write(day + "/" + month + "/" + year)

    var currentTime1 = new Date()

    var hours = currentTime1.getHours()

    var minutes = currentTime1.getMinutes()

    if (minutes < 10)

    minutes = "0" + minutes

    document.write(hours + ":" + minutes + " ")

    if(hours > 11){

    document.write("PM")

    } else {

    document.write("AM")

    }

    //-->

    </script>

    </h4>

    What exactly is your problem here? I'm not sure I understand what you're saying.

    Is it that it's not working in 24 hours time and you need it to? Or is it in 24 hours time and you want it with AM/PM?

×
×
  • Create New...