如何用西班牙语翻译日期? [英] How to translate date in spanish?

查看:47
本文介绍了如何用西班牙语翻译日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要转换这个日期:1443729984884

I need to convert this date: 1443729984884

在此日期:2015 年 10 月 1 日 22:06

in this date: 01 octubre 2015 22:06

有没有办法用 angular 过滤器做到这一点?

Is there a way to do this with the filters in angular ?

推荐答案

Angular 支持 i18n 位置标准 |全球化|国际化.当谈到数字或日期格式时,Angular 依赖于 $locale 服务.以下是 angular 当前支持的位置列表:

Angular supports i18n Standard for location | globalization | internationalization. When it comes to number or date formatting Angular relies on $locale service. Here is the list of locations currently supported by angular:

http://cdnjs.com/libraries/angular-i18n/

这是一个关于如何支持西班牙语言环境的示例:

Here is an example on how to support spanish locale:

在线演示

<html ng-app>
 <head>

   <script src="angular.js"></script>
   <script src="i18n/angular-locale_es-es.js"></script>

 </head>
 <body >
     <span ng-non-bindable>{{1443729984884 | date:'dd MMMM yyyy hh:mm'}}</span>:
     <span>{{1443729984884 | date:'dd MMMM yyyy hh:mm'}}</span><br>
</body>
</html>

这篇关于如何用西班牙语翻译日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆