ANGULARJS Filter Filter-time Date Format-render Date Format-$filter

Source: Internet
Author: User

  

today, just write an article about these Problems.

Say no more directly on chestnuts

Regardless of whether the HTML format or the JS format must be written in the controller

  

  

New Date () Gets the current time  
The return format is listed below yyyy-mm-ddd//is the returned format
$scope. wwwwwww = $filter (new Date (), ' Yyyy-mm-dd ')

or write like This.
This specifies that the date type can be omitted without writing The following is superfluous but I feel like someone's going to be in a dead alley, so hey.

This is written in the HTML Template.

  

You'll get time on the Page.

  

  

The following words are written in HTML

  

Inside the HTML template

Date is a fixed routine

YYYY-MM-DD hh:mm will say below

  

The time on the page

  

The format of the returned date is explained below

The italic red Word is the above date explanation

Custom Date Formatting:
Month and day: ({{nativedate | date: ' Yyyy-mm-dd '}}) 2017-01-06
Hours and seconds: ({{nativedate | date: ' HH:mm:ss.sss '}}) 21:22:09.990

Year Formatting:
four-bit year: ({{nativedate | date: ' yyyy '}})
Two-Bit year: ({{nativedate | date: ' yy '}}) 17
One year: ({{nativedate | date: ' y '}}) 2017


Month Formatting:
English month: ({{nativedate | date: ' MMMM '}}) April
English month abbreviation: ({{nativedate | date: ' MMM '}}) APR
two-digit month: ({{nativedate | date: ' MM '}})
The month ordinal of the year: ({{nativedate | date: ' M '}}) 4

Date Formatting:
Numeric date: ({{nativedate | date: ' dd '}})
Day of the one month: ({{nativedate | date: ' d '}}) 6
English week: ({{nativedate | date: ' Eeee '}}) Thursday
English Week abbreviation: ({{nativedate | date: ' EEE '}}) Thu

Hour formatting:
24-hour Digital hours: ({{nativedate | date: ' HH '}})
Hours of the day: ({{nativedate | date: ' H '}}) 21
12-hour Digital hours: ({{nativedate | date: ' hh '}}) 04
Hours of the morning or afternoon: ({{nativedate | date: ' H '}}) 9

Minute formatting:
number of minutes: ({{nativedate | date: ' mm '}})
The first minute of the one hour: ({{nativedate | date: ' M '}}) 40

Number of seconds to format:
number of seconds: ({{nativedate | date: ' ss '}})
Seconds within a minute: ({{nativedate | date: ' s '}}) 8
Number of milliseconds: ({{nativedate | date: ' SSS '}}) 990

Local date formatting
({{nativedate | date: ' Medium '}}) APR 4:40:08 PM
({{nativedate | date: ' short '}}) 4/14/16 4:40 PM
({{nativedate | date: ' Fulldate '}}) thursday, April 14, 2017
({{nativedate | date: ' Longdate '}}) April 14, 2017
({{nativedate | date: ' Mediumdate '}}) APR 14, 2017
({{nativedate | date: ' ShortDate '}}) 4/14/17
({{nativedate | date: ' Mediumtime '}}) 4:40:08 PM
({{nativedate | date: ' Shorttime '}}) 4:40 PM

  

The above is the ANGULARJS filter return date of the explanation there is no place to look at the big God Pointing twos

  

  

ANGULARJS Filter Filter-time Date Format-render Date Format-$filter

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.