Results 1 to 3 of 3

Thread: get server date/time

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    May 2013
    Posts
    1,126

    get server date/time

    how can I get the server date/time using javascript?

  2. #2
    Smooth Moperator techgnome's Avatar
    Join Date
    May 2002
    Posts
    34,531

    Re: get server date/time

    you don't... javascript runs on the client... not the server...

    well, that's not 100% accurate... you can get the time in JS, but you still have to run something on the server, get the time, then return it back to the JS...

    -tg
    * I don't respond to private (PM) requests for help. It's not conducive to the general learning of others.*
    * I also don't respond to friend requests. Save a few bits and don't bother. I'll just end up rejecting anyways.*
    * How to get EFFECTIVE help: The Hitchhiker's Guide to Getting Help at VBF - Removing eels from your hovercraft *
    * How to Use Parameters * Create Disconnected ADO Recordset Clones * Set your VB6 ActiveX Compatibility * Get rid of those pesky VB Line Numbers * I swear I saved my data, where'd it run off to??? *

  3. #3
    Fanatic Member
    Join Date
    Jun 2008
    Posts
    1,023

    Re: get server date/time

    if you wish to get the server time, i would suggest using php or any other server sided language like asp inside the javascript function
    Code:
    alert("<?php echo date("H:i:s", time()); ?>");
    http://php.net/manual/en/function.date.php

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