Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with Date ... 5

Status
Not open for further replies.

Rodie

Programmer
Jun 27, 2004
132
0
0
FR
Hi all [bigglasses]

I want to add "n" days to a date. So, I use the functions "Format()" and "DateAdd()" like that:
Code:
Dim final_date as Date
final_date = day & " " & month & " " & year  [COLOR=green]' 28 6 2004[/color]
final_date = Format(final_date, "General Date")
final_date = DateAdd("d", n, final_date)

The problem : on differents computers, "Format()" gives 28/6/2004 or 6/28/2004.

My program must work on all computers, so I don't where I can't fix "d m yyyy" in my code...

Thanks for your help.
Rodie [bigears]
 
Anyway, in my post, final_date is a REAL date:
final_date = DateAdd("d", n, DateSerial(theYear, theMonth, theDay))

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top