Time and Date Question

Results 1 to 3 of 3

Thread: Time and Date Question

  1. #1
    yolisten Guest

    Default Time and Date Question

    How do I assign Time and Date into a variable?<BR><BR>Below is what I would do for Time, but I do not think this would<BR>work:<BR><BR>strTime = &#060;% = Time %&#062;<BR><BR>I do not know what keyword to use in ASP for date. I guess it is "date", but I cannot find it in the book I am using.<BR>Thanks!<BR><BR>

  2. #2
    Join Date
    Dec 1969

    Default You must have a bad book...

    First of all, you would never do this:<BR><BR>&nbsp; &nbsp; &nbsp; strTime = &#060;% = Time %&#062;<BR><BR>unless you wanted something like this to appear *IN THE BROWSER*:<BR><BR>&nbsp; &nbsp; &nbsp; strTime = 6:31:13 PM<BR><BR>You would *probably* do something like<BR><BR>&nbsp; &nbsp; &nbsp; &#060;%<BR>&nbsp; &nbsp; &nbsp; ... lots of other code ...<BR>&nbsp; &nbsp; &nbsp; strTime = Time<BR>&nbsp; &nbsp; &nbsp; ... and other code ...<BR>&nbsp; &nbsp; &nbsp; %&#062;<BR><BR>Except that naming that variable "strTime" is pretty silly since it is *NOT* a "str"ing, at all. It is a VARIANT (as are all VBS variables) that *currently* (after that statement) would be holding a Date/Time value. But not a string.<BR><BR>And yes, the keyword for current date in ASP is indeed DATE.<BR><BR>Why not go get the official VBScript docs from the Microsoft web site? msdn.microsoft.com/scripting and then VBScript and then documentation and you should be able to find how to download them.<BR><BR>You can also get to them via the "VBScript Reference" link in the left hand panel of this very page, but the HTML format there is not as fast or friendly as the downloaded version.<BR><BR>And it&#039s probably time to toss that book and find one more geared towards beginners?<BR><BR><BR>

  3. #3
    yolisten Guest

    Default RE: You must have a bad book...

    Thanks for help! I was using the Beginner ASP book, from Wrox. I am quite sure date is in there, but the problem I am finding out about Wrox books is that their indexes are not clear to pointing folks in the right direction. Especially their Programmer&#039s Reference on ASP, that index is horrible!<BR><BR>Then again, maybe it&#039s just me.

Posting Permissions

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