Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date manipulation
Message
 
À
09/11/2000 11:00:47
Information générale
Forum:
Visual Basic
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00439700
Message ID:
00439910
Vues:
15
>Hi all,
>
>What is the best way to store/manipulate dates with VB/Access applications so that regional settings won't interfere.
>
>Should I store date values as character and retrieve with date literals and format function or is there another alternative?
>
>Also ... is it the regional settings that reverts a date from october 12, 2000 to december 10, 2000?

Always remember that VB internally stores the date as mm/dd/yy (the US format).

You should always work with this format in mind (cdate, dateadd, datediff, ...).

When you need to display or when users need to input dates, always use a mask that has 4 digits for the year part (yyyy/mm/dd). This way, you should avoid all problems related to dates.

For input, you should also consider using the DateTimePicker control of VB6.
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform