This function returns the list of server date formats supported.
Syntax
ESS_FUNC_M EssOtlGetServerDateFormats( ESS_HCTX_T hCtx, ESS_STR_T localeStr, ESS_USHORT_T* pcount, ESS_STR_T** ppdateStrings, ESS_STR_T** ppformatStrings)
Parameter | Data Type | Description |
---|---|---|
hCtx | ESS_HCTX_T | Server context handle |
localeStr | ESS_STR_T | Locale in which the example date Strings to be generated.
|
pcount | ESS_USHORT_T* | Count of date formats supported |
ppdateStrings | ESS_STR_T** | Returns the example current date in different date formats as an array (to be de allocated). |
ppformatStrings | ESS_STR_T** | Returns the array of formats supported (to be de allocated). |
Return Value
Returns:
0—If successful
Values are contained in ppdateStrings and ppformatStrings.
Error number—If unsuccessful
Example
void TestGetSetDateFormatString()
{
ESS_STS_T sts = ESS_STS_NOERR;
ESS_HOUTLINE_T hOutline = ESS_NULL;
ESS_OBJDEF_T Object;
ESS_SHORT_T length = 80;
ESS_STR_T dateFormatString = "";
ESS_STR_T localeStr;
ESS_USHORT_T count, i;
ESS_STR_T* pdateStrings;
ESS_STR_T* pformatStrings;
memset(&Object, '\0', sizeof(Object));
Object.hCtx = hCtx;
Object.ObjType = ESS_OBJTYPE_OUTLINE;
Object.AppName = szAppName;
Object.DbName = szDbName;
Object.FileName = szFileName;
sts = EssOtlOpenOutline(hCtx, &Object,
ESS_TRUE, ESS_TRUE, &hOutline);
/* Get current value */
sts = EssOtlGetDateFormatString(hOutline, &dateFormatString);
printf("EssOtlGetSMDateFormatString sts: %d \n", sts);
printf("\tDate format string: %s\n", dateFormatString);
printf("\n");
localeStr = "English_UnitedStates.Latin1@Binary";
sts = EssOtlGetServerDateFormats(hCtx, localeStr,
&Count, &pdateStrings, &pformatStrings);
printf("EssOtlGetServerDateFormats sts: %d \n", sts);
for (i = 0; i < count; i++)
{
printf("\nCase with %s:\n", pformatStrings[i]);
sts = EssOtlSetDateFormatString(hOutline,
pformatStrings[i]);
printf("EssOtlSetSMDateFormatString sts: %d \n", sts);
SaveOutline(hOutline);
sts = EssOtlGetDateFormatString(hOutline,
&dateFormatString);
printf("EssOtlGetSMDateFormatString sts: %d \n", sts);
printf("\tDate format string: %s\n", dateFormatString);
}
sts = EssUnlockObject(hCtx, Object.ObjType,
Object.AppName, Object.DbName, Object.FileName);
sts = EssOtlCloseOutline(hOutline);
printf("EssOtlCloseOutline sts: %d\n",sts);
}
See Also