-
August 30th, 2012, 10:12 AM
#1
[RESOLVED] How to format '2/13/2012' date to 'February 13, 2012'
Hi,
Let's say I have the following statement in VB6:
Code:
'-subject and className are strings, and classDate is a date
subject = "Student Registered: " & className & " on " & classDate
So, once the line executes, the content of subject would be
"Student Registered: How To Not Be Bad at TF2 on 2/13/2012"
However, I would like subject to either be:
"Student Registered: How To Not Be Bad at TF2 on Feb 13, 2012" or "Student Registered: How To Not Be Bad at TF2 on February 13, 2012"
How can I accomplish this? Trying to google this topic keeps sending me to VB.NET forum posts, but I need to know how to format a date in VB6.
Thanks!
-
August 30th, 2012, 10:40 AM
#2
Re: How to format '2/13/2012' date to 'February 13, 2012'
Try:
Code:
subject = "Student Registered: " & className & " on " & Format(classDate,"mmm dd, yyyy")
'or
subject = "Student Registered: " & className & " on " & Format(classDate,"mmmm dd, yyyy")
JG
... If your problem is fixed don't forget to mark your threads as resolved using the Thread Tools menu ...
-
August 30th, 2012, 10:58 AM
#3
Re: [RESOLVED] How to format '2/13/2012' date to 'February 13, 2012'
Thanks, jggtz!
If anyone's curious, I also found what I *think* is a page on VB6 formatting characters: http://dltechdev.com/vb/VBFormat.htm
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|