Suggest You
#1 in Business Subscribe Email Print

You are here: Home > Computers and Technology > Computers and Technology > VBScript - FormatDateTime

Tags

  • insurance
  • pmwscriptecho
  • telephone
  • language options
  • sample return
  • wscriptecho formatdatetimenowvbgeneraldate

  • Links

  • Avoiding Bankruptcy
  • Dealing with Crushing Debt
  • Children of the 21st Century
  • Suggest You - VBScript - FormatDateTime

    Ten Top Tips for Terminating Telephone Terror
    1. Make telephone callsFew things are more terrifying than the unknown. The fear you create for yourself is far worse than the reality of cold calling. Once you start making telephone calls and continue making telephone calls
    WScript.Echo FormatDateTime(Now(),0)
    Sample return "2006/09/12 10:10:28 PM"

    WScript.Echo FormatDateTime(Now(),vbLongDate) -OR- WScript.Echo FormatDateTime(Now(),1)</xm<div style="float:right;position:relative;width:200px;padding:10px;"><a href="/article/136632/advice--OPM---The-Art-of-Leveraging.html"> OPM - The Art of Leveraging</a><br>Equity lender, hard money lender, private investor or what ever term one uses can be a great source of funds to do real estate transactions and the question of how to find them comes up often!There are numerous ways to do this, and no two </div>This article will run through some examples on how to use VBScript to change a date and/or time into different formats.</p><p>The function that makes this easier is called <i>FormatDateTime</i>.</p><p><u><b>PLEASE NOTE:</b></u><br> The format of the date and time can vary from one computer to the next because it is displayed as per settings in the "Regional and Language Options" in the "Control Panel".</p><p><b>Syntax:</b> <xmp>FormatDateTime(Date,Format)

    Date:
    Any valid date expression
    Format:
    vbGeneralDate -OR- 0 : Short date and long time
    vbLongDate -OR- 1 : Long date
    vbShortDate -OR- 2 : Short date
    vbLongTime -OR- 3 : Long time
    vbShortTime -OR- 4 : Short time (24-hour format)

    WScript.Echo FormatDateTime(Now(),vbGeneralDate) -OR- WScript.Echo FormatDateTime(Now(),0)
    Sample return "2006/09/12 10:10:28 PM"

    WScript.Echo FormatDateTime(Now(),vbLongDate) -OR- WScript.Echo FormatDateTime(Now(),1)</xm<div style="float:left;position:relative;width:200px;padding:10px;"><a href="/article/101159/advice--Debt-Validation--Do-you-have-to-pay--.html"> Debt Validation: Do you have to pay ?</a><br>It happens all the time. Debt collectors try to collect on debts that consumers have no knowledge of or never owed in the first place. So, what do you do when a bill collector demands payment in full on a debt that you never knew existed? You nee</div>/b></u><br> The format of the date and time can vary from one computer to the next because it is displayed as per settings in the "Regional and Language Options" in the "Control Panel".</p><p><b>Syntax:</b> <xmp>FormatDateTime(Date,Format)

    Date:
    Any valid date expression
    Format:
    vbGeneralDate -OR- 0 : Short date and long time
    vbLongDate -OR- 1 : Long date
    vbShortDate -OR- 2 : Short date
    vbLongTime -OR- 3 : Long time
    vbShortTime -OR- 4 : Short time (24-hour format)

    WScript.Echo FormatDateTime(Now(),vbGeneralDate) -OR- WScript.Echo FormatDateTime(Now(),0)
    Sample return "2006/09/12 10:10:28 PM"

    WScript.Echo FormatDateTime(Now(),vbLongDate) -OR- WScript.Echo FormatDateTime(Now(),1)</xm<div style="float:right;position:relative;width:200px;padding:10px;"><a href="/article/117066/advice--Penny-Stock-Winners---What-To-Do-Next.html"> Penny Stock Winners - What To Do Next</a><br>When trading penny stocks, once you've had a big success, your first thought me be about cashing out in order to enjoy the fruits of your investment. Keep in mind however that taking all the money off the table in the middle of a good deal (such </div>DateTime(Date,Format)

    Date:
    Any valid date expression
    Format:
    vbGeneralDate -OR- 0 : Short date and long time
    vbLongDate -OR- 1 : Long date
    vbShortDate -OR- 2 : Short date
    vbLongTime -OR- 3 : Long time
    vbShortTime -OR- 4 : Short time (24-hour format)

    WScript.Echo FormatDateTime(Now(),vbGeneralDate) -OR- WScript.Echo FormatDateTime(Now(),0)
    Sample return "2006/09/12 10:10:28 PM"

    WScript.Echo FormatDateTime(Now(),vbLongDate) -OR- WScript.Echo FormatDateTime(Now(),1)</xm<div style="float:left;position:relative;width:200px;padding:10px;"><a href="/article/153628/advice--How-to-Work-at-Home-and-Earn-Money.html"> How to Work at Home and Earn Money</a><br>Many people try to work at home and fail. This is because they do not know what it takes to working at home and running a business. Yes working at home is a business. First off it is not easy to work at home. It is a lot more then sitting in fron</div>date<br> vbShortDate -OR- 2 : Short date<br> vbLongTime -OR- 3 : Long time<br> vbShortTime -OR- 4 : Short time (24-hour format) </blockquote></p><p><xmp>WScript.Echo FormatDateTime(Now(),vbGeneralDate) -OR- WScript.Echo FormatDateTime(Now(),0)
    Sample return "2006/09/12 10:10:28 PM"

    WScript.Echo FormatDateTime(Now(),vbLongDate) -OR- WScript.Echo FormatDateTime(Now(),1)</xm<div style="float:left;position:relative;width:200px;padding:10px;"><a href="/article/121077/advice--Ten-Top-Tips-for-Terminating-Telephone-Terror.html"> Insurance and Its Basic Types</a><br>InsuranceWhat is insurance? How do they insure that whatever you have insured is safe and protected or can be substituted by other means? What are the merits demerits of insurance? What are the types of insurance? These questions must ting</div></b> <xmp>WScript.Echo FormatDateTime(Now(),0)
    Sample return "2006/09/12 10:10:28 PM"

    WScript.Echo FormatDateTime(Now(),vbLongDate) -OR- WScript.Echo FormatDateTime(Now(),1)
    Sample return "12 September 2006"

    WScript.Echo FormatDateTime(Now(),vbShortDate) -OR- WScript.Echo FormatDateTime(Now(),2)
    Sample return "2006/09/12"

    WScript.Echo FormatDateTime(Now(),vbLongTime) -OR- WScript.Echo FormatDateTime(Now(),3)
    Sample return "10:14:58 PM"

    WScript.Echo FormatDateTime(Now(),vbShortTime) -OR- WScript.Echo FormatDateTime(Now(),4)
    Sample return "12 September 2006"

    PLEASE NOTE:
    If you replace Now() with a fixed date without a time, in each case where normally a time is shown, it will be omitted (show only a date) and where only a time is shown (eg. vbShortTime) it will return "00:00".

    WScript.Echo FormatDateTime("2006/09/12",vbShortTime)
    Sample return "00:00"

    HTTP = HTML link (for blogs, profiles,phorums):
    <a href="http://www.suggestyou.com/article/169636/suggestyou-VBScript--FormatDateTime.html">VBScript - FormatDateTime</a>

    BB link (for phorums):
    [url=http://www.suggestyou.com/article/169636/suggestyou-VBScript--FormatDateTime.html]VBScript - FormatDateTime[/url]

    Related Articles:

    Top 7 Ways To Earn Some Extra Money

    Signaling Criteria and a Marketing Mistake

    Why Are You Paying For Traffic

    Bookmark it: del.icio.us digg.com reddit.com netvouz.com google.com yahoo.com technorati.com furl.net bloglines.com socialdust.com ma.gnolia.com newsvine.com slashdot.org simpy.com shadows.com blinklist.com