fork download
  1. #include <ctime>
  2. #include <iostream>
  3. #include <iomanip>
  4.  
  5. using namespace std;
  6.  
  7. int main() {
  8. tm tmb = { 5, 6, 7, 8, 9, 10 };
  9.  
  10. mktime(&tmb);
  11.  
  12. for(const auto i : { "%%", "%n", "%t", "%Y", "%EY", "%y", "%Oy", "%Ey", "%C", "%EC", "%G", "%g", "%b", "%h", "%B", "%m", "%Om", "%U", "%OU", "%W", "%OW", "%V", "%OV", "%j", "%d", "%Od", "%e", "%Oe", "%a", "%A", "%w", "%Ow", "%u", "%Ou", "%H", "%OH", "%I", "%OI", "%M", "%OM", "%S", "%OS", "%c", "%Ec", "%x", "%Ex", "%X", "%EX", "%D", "%F", "%r", "%R", "%T", "%p", "%z", "%Z" } ) {
  13. cout << i << "\t|\t\"" << put_time(&tmb, i) << "\"\n";
  14. }
  15. }
Success #stdin #stdout 0s 4436KB
stdin
Standard input is empty
stdout
%%	|	"%"
%n	|	"
"
%t	|	"	"
%Y	|	"1910"
%EY	|	"1910"
%y	|	"10"
%Oy	|	"10"
%Ey	|	"10"
%C	|	"19"
%EC	|	"19"
%G	|	"1910"
%g	|	"10"
%b	|	"Oct"
%h	|	"Oct"
%B	|	"October"
%m	|	"10"
%Om	|	"10"
%U	|	"40"
%OU	|	"40"
%W	|	"40"
%OW	|	"40"
%V	|	"40"
%OV	|	"40"
%j	|	"281"
%d	|	"08"
%Od	|	"08"
%e	|	" 8"
%Oe	|	" 8"
%a	|	"Sat"
%A	|	"Saturday"
%w	|	"6"
%Ow	|	"6"
%u	|	"6"
%Ou	|	"6"
%H	|	"07"
%OH	|	"07"
%I	|	"07"
%OI	|	"07"
%M	|	"06"
%OM	|	"06"
%S	|	"05"
%OS	|	"05"
%c	|	"Sat Oct  8 07:06:05 1910"
%Ec	|	"Sat Oct  8 07:06:05 1910"
%x	|	"10/08/10"
%Ex	|	"10/08/10"
%X	|	"07:06:05"
%EX	|	"07:06:05"
%D	|	"10/08/10"
%F	|	"1910-10-08"
%r	|	"07:06:05 AM"
%R	|	"07:06"
%T	|	"07:06:05"
%p	|	"AM"
%z	|	"+0000"
%Z	|	"UTC"