@@ -9,86 +9,66 @@ create temporary view v as select col from values
99 (timestamp ' 2020-01-01 01:33:33.123Asia/Shanghai' ),
1010 (timestamp ' 2100-01-01 01:33:33.123America/Los_Angeles' ) t(col);
1111
12- -- ------------------------- '1 12 123 1234 12345 123456 1234567 12345678 123456789 1234567890'
1312select col, date_format(col, ' G GG GGG GGGG' ) from v;
14- select col, date_format(col, ' GGGGG' ) from v;
1513
1614select col, date_format(col, ' y yy yyy yyyy yyyyy yyyyyy yyyyyyy yyyyyyyy yyyyyyyyy yyyyyyyyyy' ) from v;
17- select col, date_format(col, ' yyyyyyyyyyy' ) from v;
1815
1916select col, date_format(col, ' Y YY YYY YYYY YYYYY YYYYYY YYYYYYY YYYYYYYY YYYYYYYYY YYYYYYYYYY' ) from v;
20- select col, date_format(col, ' YYYYYYYYYYY' ) from v;
2117
2218select col, date_format(col, ' q qq' ) from v;
23- select col, date_format(col, ' qqq' ) from v;
2419
2520select col, date_format(col, ' Q QQ QQQ QQQQ' ) from v;
26- select col, date_format(col, ' QQQQQ' ) from v;
2721
2822select col, date_format(col, ' M MM MMM MMMM' ) from v;
29- select col, date_format(col, ' MMMMM' ) from v;
3023
3124select col, date_format(col, ' L LL' ) from v;
32- select col, date_format(col, ' LLL' ) from v;
3325
3426select col, date_format(col, ' w ww' ) from v;
35- select col, date_format(col, ' www' ) from v;
3627
3728select col, date_format(col, ' W' ) from v;
38- select col, date_format(col, ' WW' ) from v;
3929
4030select col, date_format(col, ' u uu uuu uuuu' ) from v;
41- select col, date_format(col, ' uuuuu' ) from v;
4231
4332select col, date_format(col, ' E EE EEE EEEE' ) from v;
44- select col, date_format(col, ' EEEEE' ) from v;
4533
4634select col, date_format(col, ' F' ) from v;
47- select col, date_format(col, ' FF' ) from v;
4835
4936select col, date_format(col, ' d dd' ) from v;
50- select col, date_format(col, ' ddd' ) from v;
5137
5238select col, date_format(col, ' DD' ) from v where col = timestamp ' 2100-01-01 01:33:33.123America/Los_Angeles' ;
53- select col, date_format(col, ' DD' ) from v;
5439select col, date_format(col, ' D DDD' ) from v;
55- select col, date_format(col, ' DDDD' ) from v;
5640
5741select col, date_format(col, ' H HH' ) from v;
58- select col, date_format(col, ' HHH' ) from v;
5942
6043select col, date_format(col, ' h hh' ) from v;
61- select col, date_format(col, ' hhh' ) from v;
6244
6345select col, date_format(col, ' k kk' ) from v;
64- select col, date_format(col, ' kkk' ) from v;
6546
6647select col, date_format(col, ' K KK' ) from v;
67- select col, date_format(col, ' KKK' ) from v;
6848
6949select col, date_format(col, ' m mm' ) from v;
70- select col, date_format(col, ' mmm' ) from v;
7150
7251select col, date_format(col, ' s ss' ) from v;
73- select col, date_format(col, ' sss' ) from v;
7452
7553select col, date_format(col, ' S SS SSS SSSS SSSSS SSSSSS SSSSSSS SSSSSSSS SSSSSSSSS' ) from v;
76- select col, date_format(col, ' SSSSSSSSSS' ) from v;
7754
78- select col, date_format(col, ' a ' ) from v;
79- select col, date_format(col, ' aa ' ) from v;
55+ -- add upper function here to avoid
56+ select col, upper ( date_format(col, ' a ' ) ) from v;
8057
8158select col, date_format(col, ' VV' ) from v;
82- select col, date_format(col, ' V' ) from v;
8359
8460select col, date_format(col, ' z zz zzz zzzz' ) from v;
85- select col, date_format(col, ' zzzzz ' ) from v;
61+
8662select col, date_format(col, ' X XX XXX' ) from v;
8763select col, date_format(col, ' XXXX XXXXX' ) from v;
88- select col, date_format(col, ' XXXXXX ' ) from v;
64+
8965select col, date_format(col, ' Z ZZ ZZZ ZZZZ ZZZZZ' ) from v;
90- select col, date_format(col, ' ZZZZZZ ' ) from v;
66+
9167select col, date_format(col, ' O OOOO' ) from v;
92- select col, date_format(col, ' OO ' ) from v;
68+
9369select col, date_format(col, ' x xx xxx xxxx xxxx xxxxx' ) from v;
94- select col, date_format(col, ' xxxxxx' ) from v;
70+
71+ -- optional pattern, but the results won't be optional for formatting
72+ select col, date_format(col, ' [yyyy-MM-dd HH:mm:ss]' ) from v;
73+
74+ select col, date_format(col, " 姚123'GyYqQMLwWuEFDdhHmsSaVzZxXOV'" ) from v; -- literals
0 commit comments