mirror of https://github.com/rocboss/paopao-ce
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
341 B
17 lines
341 B
/**
|
|
* @file 格式化日期
|
|
*/
|
|
|
|
import moment from 'moment';
|
|
import 'moment/dist/locale/zh-cn';
|
|
moment.locale('zh-cn');
|
|
|
|
export const formatTime = (time: number) => {
|
|
return moment.unix(time).utc(true).format('YYYY/MM/DD HH:mm:ss');
|
|
};
|
|
|
|
export const formatRelativeTime = (time: number) => {
|
|
return moment.unix(time).fromNow();
|
|
};
|
|
|