SheetJS / ssf

:memo: Spreadsheet Number Formatter

Home Page:http://oss.sheetjs.com/ssf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Inaccurate date conversion

SheetJSDev opened this issue · comments

h/t @notatestuser (from SheetJS/sheetjs#51):

$ ssf 'yyyy-mm-dd hh:mm:ss' 41722.4097222222
41722.4097222222|2014-03-24 09:49:60

That should be 2014-03-24 09:50:00

> require('ssf').parse_date_code(41722.4097222222)
{ D: 41722,
  T: 35399,
  u: 0.999997834675014,
  y: 2014,
  m: 3,
  d: 24,
  S: 59,
  M: 49,
  H: 9,
  q: 1 }

The subseconds should be rounded up in this case

Nicely done! Any chance of a publish of ssf? Appreciated.

@notatestuser thanks for your help. Finally fixed some long-standing issues with date rounding and just published 0.6.0