Deklaration: Declare Function GetDateFormat Lib "kernel32.dll" _ Alias "GetDateFormatA" ( _ ByVal Locale As Long, _ ByVal dwFlags As Long, _ lpDate As SYSTEMTIME, _ ByVal lpFormat As Any, _ ByVal lpDateStr As String, _ ByVal cchDate As Long) As Long Beschreibung: Parameter:
Locale Konstanten: Const LOCALE_SYSTEM_DEFAULT = &H400 ' Zeitformat des Systems Const LOCALE_USER_DEFAULT = &H800 ' Zeitformat des aktuellen Benutzers Rückgabewert: Beispiel: Private Declare Function GetDateFormat Lib "kernel32.dll" _ Alias "GetDateFormatA" ( _ ByVal Locale As Long, _ ByVal dwFlags As Long, _ lpDate As SYSTEMTIME, _ ByVal lpFormat As Any, _ ByVal lpDateStr As String, _ ByVal cchDate As Long) As Long Private Declare Sub GetLocalTime Lib "kernel32.dll" (lpSystemTime As SYSTEMTIME) Private Type SYSTEMTIME wYear As Integer wMonth As Integer wDayOfWeek As Integer wDay As Integer wHour As Integer wMinute As Integer wSecond As Integer wMilliseconds As Integer End Type ' GetDateFormat Locale-Konstanten Private Const LOCALE_SYSTEM_DEFAULT = &H400 ' Zeitformat des Systems Private Const LOCALE_USER_DEFAULT = &H800 ' Zeitformat des aktuellen Benutzers ' GetDateFormat dwFlags-Konstanten Private Const LOCALE_NOUSEROVERRIDE = &H80000000 ' Standard-Systemformat des Datums wird genutzt und die Benutzereinstellungen ignoriert Private Const LOCALE_USE_CP_ACP = &H40000000 ' der ANSI Zeichensatz soll für die Darstellung des Formats benutzt werden Private Const DATE_SHORTDATE = &H1 ' formatiert das Datum als kurzes Datum Private Const DATE_LONGDATE = &H2 ' formatiert das Datum als langes Datum Private Const DATE_USE_ALT_CALENDAR = &H4 ' wenn ein alternativer Kalender existiert, sollen dessen Werte benutzt werden Private Const DATE_YEARMONTH = &H8 ' formatiert das Datum nach dem Monat/Jahr Format Private Const DATE_LTRREADING = &H10 ' das Datum wird von links nach rechts formatiert Private Const DATE_RTLREADING = &H20 ' das Datum wird von rechts nach links formatiert ' formatiertes Datum ausgeben Private Sub Command1_Click() Dim ST As SYSTEMTIME, FDate As String * 256, Retval As Long ' aktuelles Datum ermitteln Call GetLocalTime(ST) ' Datum formatieren Retval = GetDateFormat(0&, 0&, ST, "dddd', der 'dd MMMM yyyy", FDate, ' Len(FDate)) ' Datum ausgeben MsgBox Left$(FDate, Retval), , "Aktuelles Datum" End Sub Diese Seite wurde bereits 10.065 mal aufgerufen. |
Neu! sevCommand 4.0 Professionelle Schaltflächen im modernen Design! Mit nur wenigen Mausklicks statten auch Sie Ihre Anwendungen ab sofort mit grafischen Schaltflächen im modernen Look & Feel aus (WinXP, Office, Vista oder auch Windows 8), inkl. große Symbolbibliothek. Buchempfehlung Tipp des Monats April 2024 Skyfloy Chart von Microsoft und dazu noch gratis Tutorial für Microsoft Chart Controls für Microsoft .NET Framework 3.5 TOP Entwickler-Paket TOP-Preis!! Mit der Developer CD erhalten Sie insgesamt 24 Entwickler- komponenten und Windows-DLLs. Die Einzelkomponenten haben einen Gesamtwert von 1605.50 EUR... |
||||||||||||||||||||||
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. |