#!/usr/bin/env python
import logging
import os

import django

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "proj_hkcm.settings")
django.setup()

FLOAT_DATA_FORMAT = '{:,.2f}'

from django.utils import timezone
from datetime import datetime
import time

log = logging.getLogger(__name__)
log.debug("")

if __name__ == "__main__":
    a = timezone.localtime(timezone.now())
    print(a)
    time.sleep(3)
    b = timezone.localtime(timezone.now())
    print(b)
    # for testing longer time periods
    # a= datetime.datetime(2003, 8, 4, 8, 31, 4,0)
    # b= datetime.datetime(2004, 8, 5, 19, 32, 6,0)
    c = b - a
    # print "%s days, %.2dh: %.2dm: %.2ds" % (c.days, c.seconds // 3600, (c.seconds // 60) % 60, c.seconds % 60)
    duration = "%s days, %.2dh: %.2dm: %.2ds" % (c.days, c.seconds // 3600, (c.seconds // 60) % 60, c.seconds % 60)
    print(duration)
