Login | Register   
RSS Feed
Download our iPhone app
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: Visual Basic
Expertise: Beginner
Jul 23, 1999



Application Security Testing: An Integral Part of DevOps

VB5 - Is the Format Function Y2K Compliant

I am using the format function to format a date entered by the user. My machine's short date setting is mm/dd/yyyy. My OS is NT 4.0

Format(25/05/01,"Short Date") gives me a result of 05/01/2025. Is there a way of getting it to return 05/25/2001? I am running on NT SP3. Will it help to try SP5?

The built-in date formats are pretty poor, in my opinion. I always do my formatting with "custom" formats. If you want mm/dd/yyyy on a date, just do this:

Format(#25/05/01#, "mm/dd/yyyy")
You won't have to worry about the built-in settings if you do it this way.
DevX Pro
Comment and Contribute






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



We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.
Thanks for your registration, follow us on our social networks to keep up-to-date