Angular Basic Tutorial: expression date formatting [go]

Source: Internet
Author: User

 
    • localized date formatting:
      1. ({{today | date: ' mediumdate '}}):
    • Year formatting:
      1. Four-bit year:({{today | date: ' YYYY '}})
      2. Two-bit year:({{today | date: ' yy '}})
      3. One year:({{today | date: ' y '}})
    • Month Formatting:
      1. English Month:({{today | date: ' MMMM '}}) November
      2. English month Abbreviation:({{today | date: ' MMM '}})
      3. Two-digit month:({{today | date: ' MM '}})
      4. The month ordinal of the year:({{today | date: ' M '}})
    • date formatting:
      1. Numeric Date:
      2. The day of the one month,
      3. English week: ({{Today | date : ' Eeee '}}) Tuesday
      4. English weekday:
    • Hour formatting:
      1. 24-hour Digital Hours:({{today | date: ' HH '}})
      2. Hours of the day:({{today | date: ' H '}})
      3. 12-hour Digital Hours:({{today | date: ' HH '}})
      4. Hours of the morning or afternoon:({{today | date: ' h '}}) 2
    • Minute formatting:
      1. Number of minutes:({{today | date: ' mm '}})
      2. The first minute of the One hour:({{today | date: ' m '}})
    • Number of seconds to format:
      1. Number of seconds:({{today | date: ' SS '}})
      2. Seconds in a minute:({{today | date: ' s '}})
    • Number of milliseconds to format:
      1. Number of milliseconds:({{today | date: ' SSS '}}) 579
    • Character formatting:
      1. Last PM ID:({{today | date: ' A '}}) PM
      2. Four-bit time zone ID:({{today | date: ' Z '}}) +0800
    • Custom date formatting:
      1. Date:({{today | date: ' YYYY-MM-DD '}}) 2015-11-24
      2. Time and seconds:({{today | date: ' HH:MM:SS.SSS '}}) 14:19:24.579
source code for this lesson
1 2 3 4 var myApp = angular.module(‘myApp‘, []);myApp.controller(‘MyController‘,[‘$scope‘, ‘$parse‘, function($scope, $parse) {    $scope.today = new Date(); }]);
 

Angular Basic Tutorial: expression date formatting [go]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.