Jump to content

Recommended Posts

Posted

I'm a newbie when it comes to programming, so take it easy :P

In VB, the value "date" (whether it's a variable, caption...), displays the current date on the machine. But it doesn't work the same way for days. What can I do so that my app understands what day it is?!


Posted (edited)

Look at the Format$() function :

day_number$ = Format$(Date, "d")

day_number_2_digits$ = Format$(Date, "dd")

day_name_abbr$ = Format$(Date, "ddd")

day_name_full$ = Format$(Date, "dddd")

and so on...

"m" for month, "mmmm" for month full name, "w" for week number...

you can make more "complex" formats :

test$ = Format$(Now, "dd\t\h mmmm yyyy \- hh:mm tt")

will retrun :

"20th june 2005 - 09:05 pm"

But This Is For VB Classic, Not VB Script, Maybe VB.NET...

bye

Edited by Delprat

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...