
-----------------------------------
Ashi_Mashi2
Mon Mar 28, 2005 3:44 pm

How to recognize the date?
-----------------------------------
hi AGAIN!!
I'm designing a project, so i need lots of help..thanks for your support!

Ok...i need to get the date from the computer. Easy:

FormatDateTime (Now,vbShortDate)

but, i realized that it is different in every computer, for example, one displays mm/dd/yyyy another dd/mm/yyyy or dd/mm/yy, etc. Now, how can i distinguish which is which and use them (I specifically need to distinguish between month and date)...

Thanks AGAIN!

-----------------------------------
Tony
Mon Mar 28, 2005 3:57 pm


-----------------------------------
that's just the settings to display the date in different formats. Values VB gets from the system should be the same regardless.

-----------------------------------
Ashi_Mashi2
Mon Mar 28, 2005 4:08 pm


-----------------------------------
ok...so, is there anyway to change the setting of the computer using VB?

-----------------------------------
Tony
Mon Mar 28, 2005 4:25 pm


-----------------------------------
why would you change system's settings if the user likes it to be the other way? :?

-----------------------------------
Ashi_Mashi2
Mon Mar 28, 2005 5:20 pm


-----------------------------------
lol...ok...maybe you didnt get my point...i want to have the exact date for my program (because it is a calendar)...so, i need to exactly know today's date, month, and year (not the user, i dont care about the user!) ...so, that i can use these information to compile the rest of the program (which would convert the date to another calendar)..... 

so, if my month/date is mixed up, all my work is garbage :(

-----------------------------------
Tony
Mon Mar 28, 2005 9:55 pm


-----------------------------------
do you actually have two computers that give you different dates from the same Time function? :? 

Anyways, if you're really conserned, I would imagine there's something like

FormatDateTime (Now,vbMonth)

or something similar

-----------------------------------
Brightguy
Tue Mar 29, 2005 2:33 pm

Re: How to recognize the date?
-----------------------------------
You can choose exactly how you want the date output by Print Format(Now, "dddd, mmm d yyyy hh:mm:ss AMPM")     'Tuesday, Mar 29 2005 02:29:38 PM
However, if you're just interested in getting the month, day, hour, etc... then just use the Month, Day or Hour functions.
Print "It is now " & Hour(Now) & " o'clock."

-----------------------------------
Ashi_Mashi2
Tue Mar 29, 2005 4:25 pm


-----------------------------------
yeah...thanks a lot it works;).... just like Day(now) instead of formatdatetime (now)....

anyway...thx
