Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. chhsiao
    3. Posts
    C
    • Continue chat with chhsiao
    • Start new chat with chhsiao
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    Posts made by chhsiao

    • RE: ntptime.getTimestamp returns incorrect timestamp.

      0_1663857818576_IMG_1182.jpg

      hi @ajb2k3 ~

      Thank you so much for the reply.

      As you can see from the screenshot:
      the year-month-day (text2) shows expected date-time though.
      I would assume that we do have successful ntp connection because of text2.
      In my real code, the time-server is set as our internal time-server, and the timezone is set as 0 (for UTC).

      posted in Micropython
      C
      chhsiao
    • RE: ntptime.getTimestamp returns incorrect timestamp.

      hi @ajb2k3 ~

      Thank you so much for the reply.
      the year-month-day (text2) shows expected date-time though.
      I would assume that we do have successful ntp connection because of text2.
      In my real code, the time-server is set as our internal time-server, and the timezone is set as 0 (for UTC).

      posted in Micropython
      C
      chhsiao
    • ntptime.getTimestamp returns incorrect timestamp.

      version: UIFlow: v1.9.5

      code:

      text = M5Label('text', x=38, y=137, color=0x000, font=FONT_MONT_30, parent=None)
      text2 = M5Label('text', x=38, y=117, color=0x000, font=FONT_MONT_30, parent=None)
      ntp = ntptime.client()
      ts = ntp.getTimestamp()
      year = ntp.year()
      month = ntp.month()
      day = ntp.day()
      text.set_text('%s' % (ts))
      text2.set_text('%s-%s-%s' % (year, month, day))

      expected:
      corrected timestamp as now (2022-09-19 ish).
      saw: some strange timestamp in around 1992. (716937583)

      I'm wondering whether this is within expectation?

      posted in Micropython
      C
      chhsiao