BrainDump
  Home arrow BrainDump arrow Page 5 - VBScript: Final Date Functions
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Silverlight  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
ASP Web Hosting  
ASP.NET Web Hosting 
Windows Web Hosting
 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
BRAINDUMP

VBScript: Final Date Functions
By: James Payne
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 1
    2008-04-01

    Table of Contents:
  • VBScript: Final Date Functions
  • Here and Now
  • Time is Always Against Us
  • Timer...It Has Its Eye On You
  • The TimeValue() Function

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    VBScript: Final Date Functions - The TimeValue() Function


    (Page 5 of 5 )

    This function returns a time that you specify, ranging from 0:00:00 (aka 12:00:00 AM) to 23:59:59 (aka 11:59:59 PM). Here is an example:


    <html>

    <body>

    <script type="text/vbscript">

    document.write(TimeValue("10:15:25")) & "<br />"

    document.write(TimeValue("10:15:25 PM")) & "<br />"

    document.write(TimeValue("22:15:25")) & "<br />"

    document.write(TimeValue(#10:15:25 PM#)) & "<br />"

    document.write(TimeValue("10:15"))& "<br />"

    </script>

    </body>

    </html>

    Resulting in:

      10:15:25 AM
      10:15:25 PM
      10:15:25 PM
      10:15:25 PM
      10:15:00 AM

    Weekday() and WeekdayName()

    These two functions return the day of week, as a numeric value (1-7) and the weekday name, respectively:


    <html>

    <body>

    <script type="text/vbscript">

    document.write(Weekday(Date)) & "<br />"

    document.write("Here we give weekday a value: ") &(Weekday(2))& "<br />"

    document.write(WeekdayName(Weekday(Date))) & "<br />"

    document.write(WeekdayName(Weekday(Date),true)) & "<br />"

    document.write(WeekdayName(4))

    </script>

    </body>

    </html>

    And the final result:

      3
      Here we give weekday a value: 2
      Tuesday
      Tue
      Wednesday

    Ok, so I lied. We didn't get to the Format() functions after all. We will however get to them in a future article...maybe even the next. So check back often...or else!

    Till then...


    DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

       · Thanks for stopping by to read another article. In this episode we discuss the last...
     

    BRAINDUMP ARTICLES

    - Introduction to Office Live Workspace
    - Using MS Excel for One-way Analysis of Varia...
    - Comparing Data Sets Using Statistical Analys...
    - Import Blogger Posts into WordPress Using Wi...
    - Download WordPress from an FTP Server and Ru...
    - Install and Run WordPress in XAMPP Local Host
    - What Windows 7 Brings to the Table
    - Virtualization and Sandbox Detection
    - Advanced Firebug Techniques in Windows XP Ho...
    - Editing CSS with Firebug in Windows XP Home
    - Using Firebug in Windows XP Home
    - Migrating to Exchange Server 2007
    - Using System Restore on a Non-Bootable PC
    - Finding Logged on Users and More Scripting S...
    - Developing Macro Commands in MS Excel





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
    Stay green...Green IT