i got a date t described in seconds from 1.1.1970, and i want to check if the current time is further than 12 hours from the given time t. the following code works but it's super ugly =S

please give me some ideas how to make this code nicer :)

  private static bool sessionIsCurrent(long t)
  {
DateTime dateTime = DateTime(1970, 1, 1) + dur!"msecs"(t*1000); DateTime curTime = DateTime() + dur!"hnsecs"(Clock.currStdTime());
    return (curTime - dateTime) < dur!"msecs"(1000*60*60*12);
  }

thx for your effort

Reply via email to