Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Date Format
Message
 
À
05/03/2002 23:51:34
Information générale
Forum:
Visual Basic
Catégorie:
Bases de données DAO/RDO/ODBC/ADO
Titre:
Divers
Thread ID:
00616458
Message ID:
00628882
Vues:
25
Check for the FAQ 763 that will tell you how to retreive the registry settings.

Dates shouldn't be a problem.

Always use Date datatype to store its value in VB and in your database (datetime or smalldatetime). To display dates, always use the Format function:
? format(date, "short date")
2002/03/06
? format(date, "long date")
Wednesday, March 06, 2002
For input, prefer the DateTimePicker control. This control will alwasy return a Date datatype through its Value property.

Now, when you deal with your database, always format the date into a format that SQL will understand:
Select * from Table1 WHERE DateField = '2002/03/06'
This can be done in VB using:
SQL = "Select * from Table1 WHERE DateField = '" & format(date, "yyyy/mm/dd") & "'"
>Hi again,
>I've one query..
>can i make a application independent of regional settings of the client machine.
>like my appl supports dd/mm/yyyy format for dates.
>now if client's regional settings for date is m/d/yy, my appl would through error or may show wrong data.
>i'm using day,month and year functions but they are of no use as it uses the client settings to get the proper format...
>any solutions????
É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