Check the time by the https and not udp

Hi, with raspbian I am checking the time trough htpdate: http://www.vervest.org/htp/
It uses the https door instead of udp, because udp sometimes is locked from firewalls.
Is there a snap doing the same?

it does not look like there is one, but it should be a trivial task to create one (sounds like a good beginner task :slight_smile: )

here is a quick shot to convert just the htpdate binary to a snap:

name: htpdate
base: core18
version: '0.1'
summary: Receive time and date settings via http/https
description: |
 The  HTTP Time Protocol (HTP) is used to synchronize a computer's time with
 web servers as reference time source. This program can be used instead
 ntpdate or similar, in networks that has a firewall blocking the NTP port.
 .
 Htpdate will synchronize the computer time to Greenwich Mean Time (GMT),
 using the timestamps from HTTP headers found in web servers response (the
 HEAD method will be used to get the information).
 .
 Htpdate works through proxy servers. Accuracy of htpdate will be usually
 within 0.5 seconds (better with multiple servers). 

grade: stable
confinement: strict

apps:
  htpdate:
    command: htpdate
    plugs:
      - network
      - network-bind
      - time-control
      
parts:
  htpdate:
    plugin: nil
    stage-packages:
      - htpdate

i’ll leave it as an exercise for the reader to add a wrapper script and a daemon entry to actually call the binary sequentially from a timer and adjust the clock for the computed time drift :wink: