dcsimg
Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX

By submitting your information, you agree that devx.com may send you DevX offers via email, phone and text message, as well as email offers about other products and services that DevX believes may be of interest to you. DevX will process your information in accordance with the Quinstreet Privacy Policy.


Tip of the Day
Language: Active Server Pages (ASP)
Expertise: Beginner
Jul 7, 1999

WEBINAR:

On-Demand

Building the Right Environment to Support AI, Machine Learning and Deep Learning


Converting a System Date to a Text String

Question:

I want to retrieve the system date and convert it to a text string. I can get the system date (using the Date() function call), but I cannot write the date to a text file (using the WriteLine method from a TextStream object) unless it is in a string format. The VB Format$() function does not work in the scripting version of VB. Do you have any suggestions?

Answer:

The Format$() function of VB has been replaced by a set of new Format, functions in VBScript.

Use the FormatDateTime function to format a date.

var = FormatDateTime(Date[,NamedFormat])

where NamedFormat = 
0 - General Date
1 - Long Date
2 - Short Date
3 - Long Time
4 - Short Time
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date