當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。