[React Intl] Format Date and Time Using react-intl FormattedDate and FormattedTime
2017-07-28 20:01
2626 查看
Using the
FormattedDate and FormattedTime, they are similar, just FormattedTime contains both time and date.
Display as such:
react-intl
FormattedDateand
FormattedTimecomponents, we’ll render a JavaScript Date into both a date string and a time string in different language formats.,
FormattedDate and FormattedTime, they are similar, just FormattedTime contains both time and date.
<div> { /** <FormattedDate value={new Date(review.date)} year='2-digit' month='2-digit' day='2-digit' /> */ } <FormattedTime year='2-digit' month='2-digit' day='2-digit' value={new Date(review.date)} /> </div>
Display as such:
04/20/17, 9:16 AM
相关文章推荐
- [React Intl] Format a Date Relative to the Current Date Using react-intl FormattedRelative
- [React Intl] Format Numbers with Separators and Currency Symbols using react-intl FormattedNumber
- [React Intl] Render Content Based on a Number using react-intl FormattedMessage (plural)
- 10 ways to format time and date using JavaScript
- [React Intl] Render Content with Placeholders using react-intl FormattedMessage
- [React Intl] Render Content with Markup Using react-intl FormattedHTMLMessage
- Custom Date and Time Format Strings
- Java Date, Time and Format
- [React Intl] Install and Configure the Entry Point of react-intl
- short or long (date and time)format display
- Date and Time Format Patterns
- Custom Date and Time Format Strings
- [原创]DateTime在使用 format Custom Date and Time Format Strings时遇到的问题和解决方法
- ASP Format Date and Time Script
- Formatting Time and Date: The Time and Date Format Suffixes
- [React Intl] Use a react-intl Higher Order Component to format messages
- Java 8 Date Time API Example Tutorial – LocalDate, Instant, LocalDateTime, Parse and Format
- date and time information matlab
- Date and Time Pattern
- Kettle5.2 couldn't convert string [...] to a date using format [yyyy/MM/dd HH:mm:ss.SSS]