Skip to content

Commit

Permalink
options/ansi: Implement %P in strftime
Browse files Browse the repository at this point in the history
  • Loading branch information
Dennisbonke committed Jun 9, 2024
1 parent 0633815 commit 150710a
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions options/ansi/generic/time-stubs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,14 @@ size_t strftime(char *__restrict dest, size_t max_size,
c++;
break;
}
case 'P': {
chunk = snprintf(p, space, "%s", (tm->tm_hour < 12) ? "am" : "pm");
if(chunk >= space)
return 0;
p += chunk;
c++;
break;
}
case 'C': {
chunk = snprintf(p, space, "%.2d", (1900 + tm->tm_year) / 100);
if(chunk >= space)
Expand Down

0 comments on commit 150710a

Please sign in to comment.