anchor.diff:    lists:reverse(ReversedResult).
   
   
  +daystart(Date) ->
  +  DaystartSeconds = calendar:datetime_to_gregorian_seconds({Date, {0,0,0}}) - calendar:datetime_to_gregorian_seconds({{1970,1,1}, {0,0,0}}),
  +  DaystartSeconds * 1000.
  +
   start_chunk(Timestamp, #dbstate{daystart = undefined, date = Date} = State) ->
  -  DaystartSeconds = calendar:datetime_to_gregorian_seconds({Date, {0,0,0}}) - calendar:datetime_to_gregorian_seconds({{1970,1,1}, {0,0,0}}),
  -  Daystart = DaystartSeconds * 1000,
  -  ?D({daystart, Daystart}),
  -  start_chunk(Timestamp, State#dbstate{daystart = Daystart});
  +  start_chunk(Timestamp, State#dbstate{daystart = daystart(Date)});
   
   start_chunk(Timestamp, State) ->
     #dbstate{
  
positive.code: 
    ok = file:write(File, ChunkMap),
    {ok, Size}.
  
  
  nonzero_chunks(#dbstate{file = File, chunk_size = ChunkSize, chunk_map_offset = ChunkMapOffset}) ->
  
negative.code:     last_bidask,
      next_chunk_time = 0,
      chunk_map_offset,
      chunk_map = [],
      daystart
    }).
  
  