Using Win32 functions in Visual FoxPro Image Gallery
National Language Support
..msdn
CompareString
GetACP
GetCurrencyFormat
GetDateFormat
GetLocaleInfo
GetNumberFormat
GetOEMCP
GetStringTypeEx
GetSystemDefaultLangID
GetSystemDefaultLCID
GetSystemDefaultLocaleName
GetThreadLocale
GetUserDefaultLangID
GetUserDefaultLCID
GetUserDefaultLocaleName
GetUserGeoID
LCIDToLocaleName
LocaleNameToLCID
NormalizeString
SetUserGeoID
Code examples:
GetDateFormat
..msdn    Add comment     W32 Constants      Translate this page
Formats a date as a date string for a locale specified by the locale identifier. The function formats either a specified date or the local system date.
Code examples:
Declaration:
int GetDateFormat(
  _In_       LCID Locale,
  _In_       DWORD dwFlags,
  _In_opt_   const SYSTEMTIME *lpDate,
  _In_opt_   LPCTSTR lpFormat,
  _Out_opt_  LPTSTR lpDateStr,
  _In_       int cchDate
);
FoxPro declaration:
DECLARE INTEGER GetDateFormat IN kernel32;
    INTEGER Locale,;
    INTEGER dwFlags,;
    STRING @lpDate,;
    STRING lpFormat,;
    STRING @lpDateStr,;
    INTEGER cchDate
Parameters:
Locale [in]
Locale identifier that specifies the locale this function formats the date string for.

dwFlags [in]
Flags specifying date format options.

lpDate [in, optional]
Pointer to a SYSTEMTIME structure that contains the date information to format. Set this parameter to NULL if the function is to use the current local system date.

pFormat [in, optional]
Pointer to a format picture string that is used to form the date. E.g. "MM/dd/yyyy".

lpDateStr [out, optional]
Pointer to a buffer in which this function retrieves the formatted date string.

cchDate [in]
Size, in characters, of the lpDateStr buffer.
Return value:
Returns the number of characters written to the lpDateStr buffer if successful.
Usage:
#DEFINE DATE_LONGDATE 0x0002

cBuffer = REPLICATE(CHR(0), 256)

cValue = REPLICATE(CHR(0), 16)
GetSystemTime(@cValue)

* 1st way -- using formt flag
= GetDateFormat(;
    GetThreadLocale(),;
    DATE_LONGDATE,;
    @cValue,;
    NULL,;
    @cBuffer,;
    LEN(cBuffer))

cBuffer = STRTRAN(m.cBuffer, CHR(0), "")
? cBuffer

* 2nd way -- using format picture
cBuffer = REPLICATE(CHR(0), 256)

= GetDateFormat(;
    GetThreadLocale(),;
    0,;
    @cValue,;
    "MM-dd-yyyy",;
    @cBuffer,;
    LEN(cBuffer))

My comment:
See also: GetCurrencyFormat, GetNumberFormat
Word Index links for the GetDateFormat :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2014-09-28 11:13:33
Modified: 2014-09-28 11:23:05
Visited in last 7 days: 62
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.37), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (23.20.86.177)
3 sec.
Function group: 'Region'
8 sec.Function: 'FindWindowEx'
12 sec.Function: 'GetMenuItemInfo'
15 sec.
Function group: 'Event Logging'
20 sec.Function: 'CeRapiInvoke'
24 sec.
Function group: 'Font and Text'
28 sec.Function: 'DnsValidateName'
32 sec.Function: 'FindNextFile'
36 sec.Function: 'AVIFileRelease'
41 sec.
Function group: 'Remote Procedure Call (RPC)'
Google
Advertise here!