当前位置: 首页>>代码示例>>TypeScript>>正文


TypeScript moment.utc函数代码示例

本文整理汇总了TypeScript中moment/moment.utc函数的典型用法代码示例。如果您正苦于以下问题:TypeScript utc函数的具体用法?TypeScript utc怎么用?TypeScript utc使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了utc函数的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。

示例1: extractConferenceListData

    private extractConferenceListData(res: Response): Conference[] {
        let body: any = res.json();
        let conferenceList: Conference[] = [];

        if (body) {
            for (let x: number = 0; x < body.length; x++) {

                let conference = new Conference();

                conference.id = body[x].id;
                conference.name = body[x].name;
                conference.location = body[x].location;
                conference.startDate = new Date(body[x].startDate);
                conference.startDateStr = Moment.utc(conference.startDate).format('MM/DD/YYYY');
                conference.endDate = new Date(body[x].endDate);
                conference.endDateStr = Moment.utc(conference.endDate).format('MM/DD/YYYY');
                conference.city = body[x].city;
                conference.state = body[x].state;

                conferenceList.push(conference);
            }
        }

        return conferenceList;
    }
开发者ID:rightincode,项目名称:speakerregister,代码行数:25,代码来源:conference.service.ts

示例2:

 .then(arr => {
     let retArr = [arr[0]];
     for (let i=1; i < arr.length; i++) {
       let dateStr = arr[i].split(' to ');
       let fromTime = moment.utc(dateStr[0], 'YYYY-MM-DD HH:mm:ss Z').unix() * 1000;
       let toTime = moment.utc(dateStr[1], 'YYYY-MM-DD HH:mm:ss Z').unix() * 1000;
       retArr.push((toTime - fromTime) + '');
     }
     return retArr;
 });
开发者ID:iraghumitra,项目名称:incubator-metron,代码行数:10,代码来源:alerts-list.po.ts

示例3: transform

 transform(value) : string {
     if (!value) {
         return '';
     }
     let gmtDateTime = moment.utc(value);
     return gmtDateTime.local().format("ddd MMM DD YYYY HH:mm:ss");
 }
开发者ID:tmolteno,项目名称:TART,代码行数:7,代码来源:display-timestamp-pipe.ts

示例4: extractConferenceData

    private extractConferenceData(res: Response): Conference {
        let body: Conference = res.json();

        if (body) {

            let conference = new Conference();

            conference.id = body.id;
            conference.name = body.name;
            conference.location = body.location;
            conference.startDate = body.startDate;
            conference.startDateStr = Moment.utc(conference.startDate).format('YYYY-MM-DD');
            conference.endDate = body.endDate;
            conference.endDateStr = Moment.utc(conference.endDate).format('YYYY-MM-DD');
            conference.city = body.city;
            conference.state = body.state;

            return conference;
        } else {
            return new Conference();
        }
    }
开发者ID:rightincode,项目名称:speakerregister,代码行数:22,代码来源:conference.service.ts

示例5: constructor

	constructor() {
		super();
		this.nativeValue = utc();
	}
开发者ID:hguerrerojaime,项目名称:bong2,代码行数:4,代码来源:t.time.ts


注:本文中的moment/moment.utc函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。