#include #include #include int main (void) { UDateFormat *fmt; UErrorCode status = U_ZERO_ERROR; UDate date; UChar result[128]; UChar buffer[128]; UChar *pattern; date = ucal_getNow (); pattern = u_strFromUTF8 (buffer, 128, NULL, "yyyyMMdd hh:mm", 14, status); status = U_ZERO_ERROR; fmt = udat_open (UDAT_NONE, UDAT_NONE, "nl_BE", NULL, 0, NULL, 0, &status); if (status != U_ZERO_ERROR) u_printf ("udat_open() error!\n"); udat_format (fmt, date, result, 128, NULL, &status); if (status != U_ZERO_ERROR) u_printf ("udat_open() error!\n"); else u_printf ("Date Formatted with defaults: %S\n", result); udat_close (fmt); fmt = udat_open (UDAT_NONE, UDAT_MEDIUM, "nl_BE", NULL, 0, pattern, 14, &status); if (status != U_ZERO_ERROR) u_printf ("udat_open() error!\n"); udat_format (fmt, date, result, 128, NULL, &status); if (status != U_ZERO_ERROR) u_printf ("udat_open() error!\n"); else u_printf ("Date Formatted with defaults: %S\n", result); udat_close (fmt); fmt = udat_open (UDAT_LONG, UDAT_LONG, "nl_BE", NULL, 0, pattern, 14, &status); if (status != U_ZERO_ERROR) u_printf ("udat_open() error!\n"); udat_format (fmt, date, result, 128, NULL, &status); if (status != U_ZERO_ERROR) u_printf ("udat_open() error!\n"); else u_printf ("Date Formatted with defaults: %S\n", result); udat_close (fmt); return 0; }