date formate issue (with international date format)

J

Joy

we use
tsk.Text1 = DateFormat(tsk.Finish, pjDate_mm_dd_yyyy)
to get the uniform date format in our macros.

like, Finish = July 28
then Text1 = 7/28/2009

we will then work on the uniform date formats and convert them to other
values.

Recently, a customer outside US reported to us that some dates are incorrect.
We found that he is using MS 2000, and in Tools- > Options -> View -> Date
Format, he only has date formats like: Mon 28/1/2009 instead of Mon 1/28/2009
like we have.


the issue is the function DateFormat(tsk.Finish, pjDate_mm_dd_yyyy)
converts Finish date like "Tue 28/07/09" to "28/07/09". It is apparently
wrong.


how can we detect that users are using an international date format and so
we can get a correct format: mm/dd/yyyy for all dates??
 
J

Jan De Messemaeker

Hi,

First option: ask your overseas people to use the American Region and
Language settings (nothing to do with Project, it's the windows setting)
But if you want to make sure, write your own date formatting function.. use
Day, Month and year VBA functions - that's what I do
Because you see, from my point of view, it's 7/28/9 that is "wrong" ane
28/7/9 is "right" :))

Hope this helps,
--
Jan De Messemaeker
Microsoft Project Most Valuable Professional
+32 495 300 620
For availability check:
http://users.online.be/prom-ade/Calendar.pdf
 
J

Joy

thanks

I may change DateFormat(tsk.Start, pjDate_mm_dd_yyyy) in to
Month(tsk.Start) & "/" & Day(tsk.Start) & "/" & Year(tsk.Start)

hope it gonna work
 
R

Rod Gill

I always recommend that if you have an international audience that you use a
date format with mmm, EG Jul 7 2009. That way the date can't be mis
interpreted.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 
J

Joy

I will try it

thank you
Rod Gill said:
I always recommend that if you have an international audience that you use a
date format with mmm, EG Jul 7 2009. That way the date can't be mis
interpreted.

--

Rod Gill
Microsoft MVP for Project

Author of the only book on Project VBA, see:
http://www.projectvbabook.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top