vbscript date function equivalent

Results 1 to 4 of 4

Thread: vbscript date function equivalent

  1. #1
    kuth Guest

    Default vbscript date function equivalent

    How do i go about getting a date by converting a specified time interval in seconds. I know how to do this in vbscript but not in jscript. <BR><BR>My roundtime represents the number of seconds since 1/1/1970 0:00:00 in UTC, and dt is my date in format form.. <BR>In vbscript, <BR>dt = DateAdd( "s", timesec, #1/1/70# ) <BR>

  2. #2
    Join Date
    Dec 1969

    Default RTFM

    read the JScript docs<BR><BR>they&#039re available to the left of this page<BR><BR>j

  3. #3
    Join Date
    Dec 1969

    Default Better docs...

    In my opinion, the NS ref manual for JS is superior in readability:<BR><BR>http://developer.netscape.com/docs/manuals/communicator/jsref/contents.htm<BR><BR>I might note that a Date value of zero *IS* the number of milliseconds since 1/1/1970 in JavaScript, so you are really all set to go!<BR><BR>Just do:<BR><BR>dt = new Date( )<BR>dt.setTime( timesec * 1000 )<BR><BR>And you are done!

  4. #4
    kuth Guest

    Default RE: Better docs...

    Thanks for the reference and example..

Posting Permissions

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