function gettimeLine(){
const now = new Date();

now.setHours( 0 );
now.setMinutes( 0 );
now.setSeconds( 1 );

const year = now.getFullYear();
const month = now.getMonth() + 1;
const $year = now.getFullYear() - ( month < 4 ? 1 : 0 );
const days = ( new Date( `${ $year + 1 }-04-01` ) - new Date( `${ $year }-04-01` ) ) / 86400000;

return ( ( now - new Date( `${ $year }-04-01` ) ) / 86400000 / days * 100 ).toFixed( 2 ) + '%';
}
undefined
gettimeLine()
"30.32%"

相关文章:

  • 2021-12-14
  • 2021-10-12
  • 2021-07-22
  • 2022-12-23
  • 2021-08-05
  • 2021-12-02
  • 2021-05-22
  • 2021-09-18
猜你喜欢
  • 2021-09-24
  • 2021-06-21
  • 2022-01-03
  • 2022-12-23
  • 2021-11-29
相关资源
相似解决方案