Lines Matching refs:format
47 static void date(UDate when, const UChar *tz, UDateFormatStyle style, const char *format, UErrorCode *status);
48 static UDate getWhen(const char *millis, const char *seconds, const char *format, UDateFormatStyle style, const char *parse, const UChar *tz, UErrorCode *status);
72 const char *format = NULL;
98 /* display date in long format */
102 /* display date in medium format */
106 /* display date in short format */
110 else if(strcmp(arg, "-F") == 0 || strcmp(arg, "--format") == 0) {
113 format = argv[optInd];
161 when = getWhen(millis, seconds, format, style, parse, tz, &status);
163 format = FORMAT_MILLIS; /* output in millis */
167 date(when, tz, style, format, &status);
184 puts(" -f, --full Use full display format.");
185 puts(" -l, --long Use long display format.");
186 puts(" -m, --medium Use medium display format.");
187 puts(" -s, --short Use short display format.");
188 puts(" -F <format>, --format <format> Use <format> as the display format.");
192 puts(" -P <string> Parse <string> as the time, output in millis format.");
238 /* Format the date */
243 const char *format,
253 if( format != NULL ) {
254 if(!strcmp(format,FORMAT_MILLIS)) {
257 } else if(!strcmp(format, FORMAT_SECONDS)) {
264 if ( format != NULL ) {
265 charsToUCharsDefault(uFormat,sizeof(uFormat)/sizeof(uFormat[0]),format,-1,status);
291 static UDate getWhen(const char *millis, const char *seconds, const char *format,
308 if( format != NULL ) {
309 if(!strcmp(format,FORMAT_MILLIS)) {
312 } else if(!strcmp(format, FORMAT_SECONDS)) {
319 if ( format != NULL ) {
320 charsToUCharsDefault(uFormat,sizeof(uFormat)/sizeof(uFormat[0]), format,-1,status);