Skip to content
  • Yorick Peterse's avatar
    Implement std::time::Time using mostly Inko · 63bc941d
    Yorick Peterse authored
    This changes the implementation of std::time::Time so it no longer
    relies on high-level date/time instructions provided by the VM. Instead
    of these instructions we now use an algorithm ported over from musl to
    decompose a Unix timestamp. The individual parts of a Time can in turn
    be used to reconstruct a Unix timestamp. The VM in turn only provides
    some low level instructions to get a timestamp, the offset, and a flag
    indicating if DST is active.
    
    A side effect of this approach is that we have to implement time parsing
    and formatting ourselves. While this will take some time (e.g. we need
    to implement hash maps first) all if this work is necessary anyway. On
    top of that both time parsing and formatting was somewhat broken when
    using the "time" crate anyway. Until time parsing/formatting is
    reimplemented the methods have been changed so they produce dummy data
    or throw an error.
    63bc941d