简体   繁体   English

更改方法:2018年1月3日21:00:00至1月3日21:00(使用AngularJs)

[英]How to change: 2018-01-03 21:00:00 to 3 January 21:00 with AngularJs

我应该怎么办才能2018年1月3日21:00:00得到1月3日21:00(无年)

you can use the date pipe: https://docs.angularjs.org/api/ng/filter/date 您可以使用日期管道: https : //docs.angularjs.org/api/ng/filter/date

{{yourDate | date: 'dd MMMM HH:mm'}}

Example with your API: API的示例:

http.get(url).then(function(res) {
  $scope.data = res.list;

  angular.forEach($scope.data, function(item) {
    item.dt_txt = new Date(item.dt_txt);
  });
});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 您如何在Google Apps脚本中设置“ 2018-09-21 16:00:00 -0500”的格式? - How do you format “2018-09-21 16:00:00 -0500” in google apps script? 您如何只读取像这样的字符串中的数字:2018年2月5日星期一21:00:39 +0000 - How could you read only the numbers in a string like this: Mon, 05 Feb 2018 21:00:39 +0000 在javascript中,我将如何将 2016-05-21 20:00:00 转换为 2016 年 12 月 31 日 00:00:50 UTC+0200 - In javascript how will i convert 2016-05-21 20:00:00 to December 31 2016 00:00:50 UTC+0200 Javascript日期格式化Fri Jun 21 00:00:00 UTC + 0100 2013 to iso 8601(2013-06-21) - Javascript date formatting Fri Jun 21 00:00:00 UTC+0100 2013 to iso 8601 (2013-06-21) 创建小时数数组:00:00、01:00、02:00 - Create array of hours: 00:00, 01:00, 02:00 notepad ++ regex将“00”替换为“01”,“02”,“03”等 - notepad++ regex replace “00” with “01”, “02”, “03” etc 所选日期大部分时间为 01/01/0001 00:00:00 - Selected date is most of the time 01/01/0001 00:00:00 如何将时间设置为始终:00:00:00? - How to set time to always: 00:00:00? 如何使用00:00:00时间戳获取日期 - How to get date with 00:00:00 timestamp 如何从“Thu Aug 20 00:00:00 GMT+01:00 2020”创建正确的 new Date() - How to create correct new Date() from “Thu Aug 20 00:00:00 GMT+01:00 2020”
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM