Record front-end small details

A 13-bit timestamp is converted to a 10-bit timestamp.

import {
    
     getUnixTime } from 'date-fns';

const value = getUnixTime(tenValue);

Gets the total number of days between two dates (inclusive).

// start 和 end 都是10位的时间戳
const days = differenceInDays(new Date(end * 1000), new Date(begin * 1000));

Convert timestamp to Date format.
insert image description here
or

new Date(1675612799 * 1000)

or

import {
    
     fromUnixTime } from 'date-fns';

fromUnixTime(1675612799) 

Guess you like

Origin blog.csdn.net/Kate_sicheng/article/details/128243145