Results 1 to 4 of 4

Thread: Echoing time/date

Threaded View

  1. #1

    Thread Starter
    Addicted Member MoE70's Avatar
    Join Date
    May 2006
    Posts
    185

    Echoing time/date

    hi

    does anyone know how i might be able to echo a java script

    example

    chat box
    PHP Code:
    <?php echo $msg?><i> <script type="text/javascript">
    <!--
    var currentTime = new Date()
    var hours = currentTime.getHours()
    var minutes = currentTime.getMinutes()

    if (minutes < 10)
    minutes = "0" + minutes

    document.write(hours + ":" + minutes)
    if(hours > 11){
    document.write("pm")
    } else {
    document.write("am")
    }
    //-->
    </script></i>
    but i want to print th time after $msg

    i tried the normal php tags time() but it prints it without a format...just numbers

    i tried print date("D dS M,Y h:i a"); but that prints a different time zone. my hosting company's time zone perhaps
    Last edited by MoE70; Jun 4th, 2006 at 08:30 PM.

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