Esempio n. 1
0
    def test_normal(self):
        # print(datetime.fromtimestamp(1414524783))
        # dt = arrow.Arrow(2015, 6, 17, 13, 33, 3, tzinfo='+07:00')
        # dt = LocalDateTime.now()
        lt = LocalDateTime.now(tzinfo='+07:00')
        print(lt.humanize())
        # print(lt)
        # print(arrow.now())
        # print(dt.timestamp)
        # print(lt.timestamp)
        # ago = arrow.now().fromtimestamp(1414524783)
        # ago = arrow.now().fromtimestamp(lt.human_to_date_stamp('2 seconds ago'))
        # print(lt.fromtimestamp(lt.human_to_date_stamp('2 seconds ago')))
        nw = datetime.now()

        print lt.human_to_date('an year ago')
        print lt.human_to_date_stamp('now')
        print(LocalDateTime.from_time_stamp(lt.human_to_date_stamp('29 years ago')))

        print(nw)
        print(time.time())
    def test_normal(self):
        # print(datetime.fromtimestamp(1414524783))
        # dt = arrow.Arrow(2015, 6, 17, 13, 33, 3, tzinfo='+07:00')
        # dt = LocalDateTime.now()
        lt = LocalDateTime.now(tzinfo='+07:00')
        print(lt.humanize())
        # print(lt)
        # print(arrow.now())
        # print(dt.timestamp)
        # print(lt.timestamp)
        # ago = arrow.now().fromtimestamp(1414524783)
        # ago = arrow.now().fromtimestamp(lt.human_to_date_stamp('2 seconds ago'))
        # print(lt.fromtimestamp(lt.human_to_date_stamp('2 seconds ago')))
        nw = datetime.now()

        print lt.human_to_date('an year ago')
        print lt.human_to_date_stamp('now')
        print(
            LocalDateTime.from_time_stamp(
                lt.human_to_date_stamp('29 years ago')))

        print(nw)
        print(time.time())