Make datetime local variable in prepareData