Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 202
  • Last Modified:

URGENT: Date formatting function on PC with regional setting set to French (Canada)

Hi All,

First off, sorry about the point value, but it's all I have.

I have a database system with forms, installed on various user PC's. Most PC's regional settings are set to US (English) but I have a couple that are set to French (Canada).

The problem is in a part where I have a user enter a date in text form into a textbox in the format "mm-dd-yy".

When I type in "01-01-05" and format it as a date on the US ENglish boxes, the date is formatted fine, but on the french PC's, it becomes "01/05/2001".

Obviously, not good. I've been trying variations of date formatting functions on it, but to no avail.

Anyone know of a way to force the locale to US through code, or any other solution.

I'll increase the points to 200 if someone doesn't mind this being open for a while as I redeem more points.

Thx all...
0
knuckle05
Asked:
knuckle05
1 Solution
 
knuckle05Author Commented:
Nevermind....solved it.

When having problems with differing Short Date formats, always convert your dates into a format where the month name is spelled out.

Format$(CDate(strDay2 & " " & MonthName(strMth2, False) & " " & strYr2), JetDateFmt)

Note: JetDateFmt is a custom format pattern that I made, not an intrinsic constant
0
 
EE_AutoDeleterCommented:
knuckle05,
Because you have presented a solution to your own problem which may be helpful to future searches, this question is now PAQed and your points have been refunded.

EE_AutoDeleter
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now