Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/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
Angular 角度:DatePipe.transform为月份返回0_Angular_Angular2 Pipe - Fatal编程技术网

Angular 角度:DatePipe.transform为月份返回0

Angular 角度:DatePipe.transform为月份返回0,angular,angular2-pipe,Angular,Angular2 Pipe,我正在使用DatePipe将日期字符串的格式设置为“2017年10月25日”到“2017年10月25日”。下面是片段 this.datePipe.transform('25-Oct-2017', 'yyyy-mm-dd') 它返回“2017-00-25”。请使用正确的表示符号 this.datePipe.transform('25-Oct-2017', 'y-MM-dd') y(2015年) 毫米(10) dd(25) mm表示分钟。使用MM。

我正在使用DatePipe将日期字符串的格式设置为“2017年10月25日”到“2017年10月25日”。下面是片段

this.datePipe.transform('25-Oct-2017', 'yyyy-mm-dd')

它返回“2017-00-25”。

请使用正确的表示符号

 this.datePipe.transform('25-Oct-2017', 'y-MM-dd')
  • y(2015年)
  • 毫米(10)
  • dd(25)
mm表示分钟。使用MM。