Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/visual-studio-2012/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Datetime 如何使用EBNF表示日期时间格式_Datetime_Ebnf - Fatal编程技术网

Datetime 如何使用EBNF表示日期时间格式

Datetime 如何使用EBNF表示日期时间格式,datetime,ebnf,Datetime,Ebnf,我想知道如何使用EBNF表示“datetime”格式,如yyyy-MM-dd-hh:MM。使用EBNF表示此格式的一种可能方法如下所示。表达式只解析法定年、月和时间戳。但是,它允许任何月份最多有31天 Timestamp = [ "-" ] Year "-" Month "-" Day " " Time ; Year = Digit Digit Digit Digit ; Month = "0" Digit | "1" "0".."2" ; Day = "0".."2" Digit | "3"

我想知道如何使用EBNF表示“datetime”格式,如yyyy-MM-dd-hh:MM。

使用EBNF表示此格式的一种可能方法如下所示。表达式只解析法定年、月和时间戳。但是,它允许任何月份最多有31天

Timestamp = [ "-" ] Year "-" Month "-" Day " " Time ;
Year = Digit Digit Digit Digit ;
Month = "0" Digit | "1" "0".."2" ;
Day = "0".."2" Digit | "3" "0".."1" ;
Time = Hour ":" Minute ;
Hour = "0".."1" Digit | "2" "0".."3" ;
Minute = "0".."5" Digit ;
Digit = "0".."9" ;