| |

Fortgeschrittene ProgrammierungLösung | |  | Autor: Thomas | Datum: 28.08.01 19:21 |
| Hallo Leute,
Danke fürs Suchen
Die Lösung ist die Verwendung von Datumsliteralen.
Setzt man Datum in Hochkomma wie einen String ist das Format abhängig von den Ländereinstellungen. Setzt man das Datum in ## funktionierts.
Hier einige Infos aus der MSDN dazu:
Date
In Visual Basic, never type dates as strings in your code. Entering dates in code in the format #month/day/year#
ensures that the date will be interpreted correctly in any system locale. Because Visual Basic allows only English/U.S.
as a programming locale, the date will be the same to a user wherever your application is run.
For example, if a user enters 8/2/97 in an input dialog box,
CDate ("8/2/97")
returns the following results, based on the system locale:
Operating system Output
French/France 08/02/97 (= February 8, 1997)
English/U.S. 8/2/97 (= August 2, 1997)
Conversely, if you enter 8/2/97 in code,
CDate (#8/2/97#)
returns the results in the following table, based on the code locale:
Operating system Output
French/France 02/08/97 (= August 2, 1997)
English/U.S. 8/2/97 (= August 2, 1997)
If the user is in France and enters 8/2/97, the application will interpret this date as February 8, 1997,
because the date format in France is day/month/year. If a user in the United States enters the same
string, the application will understand August 2, 1997, because the date format is month/day/year.
...........................
You can use date/time literals in your code by enclosing them with the number sign (#),
in the same way you enclose string literals with double quotation marks (""). For example, you can
compare a Variant containing a date/time value with a literal date:
If SomeDate > #3/6/93# Then
Similarly, you can compare a date/time value with a complete date/time literal:
If SomeDate > #3/6/93 1:20pm# Then
If you do not include a time in a date/time literal, Visual Basic sets the time part of the value to midnight (
the start of the day). If you do not include a date in a date/time literal, Visual Basic sets the date part of
the value to December 30, 1899.
Visual Basic accepts a wide variety of date and time formats in literals. These are all valid date/time values:
SomeDate = #3-6-93 13:20#
SomeDate = #March 27, 1993 1:20am#
SomeDate = #Apr-2-93#
SomeDate = #4 April 1993# |  |
 | Sie sind nicht angemeldet! Um auf diesen Beitrag zu antworten oder neue Beiträge schreiben zu können, müssen Sie sich zunächst anmelden.
Einloggen | Neu registrieren |
  |
|
sevISDN 1.0 
Überwachung aller eingehender Anrufe!
Die DLL erkennt alle über die CAPI-Schnittstelle eingehenden Anrufe und teilt Ihnen sogar mit, aus welchem Ortsbereich der Anruf stammt. Weitere Highlights: Online-Rufident, Erkennung der Anrufbehandlung u.v.m. Weitere InfosTipp des Monats Oktober 2025 Matthias KozlowskiUmlaute konvertierenErsetzt die Umlaute in einer Zeichenkette durch die entsprechenden Doppelbuchstaben (aus ä wird ae, usw.) Neu! sevPopUp 2.0 
Dynamische Kontextmenüs!
Erstellen Sie mit nur wenigen Zeilen Code Kontextmenüs dynamisch zur Laufzeit. Vordefinierte Styles (XP, Office, OfficeXP, Vista oder Windows 8) erleichtern die Anpassung an die eigenen Anwendung... Weitere Infos
|
|
|
Copyright ©2000-2025 vb@rchiv Dieter Otter Alle Rechte vorbehalten.
Microsoft, Windows und Visual Basic sind entweder eingetragene Marken oder Marken der Microsoft Corporation in den USA und/oder anderen Ländern. Weitere auf dieser Homepage aufgeführten Produkt- und Firmennamen können geschützte Marken ihrer jeweiligen Inhaber sein.
Diese Seiten wurden optimiert für eine Bildschirmauflösung von mind. 1280x1024 Pixel
|
|