One of the more recent features of the image viewer Pi3D PictureFrame is the option to show the date and time as a text overlay over your photos. In this article, I will show you how to do it and what formatting options you can use.

In the configuration.yaml file you will see this section:

  show_clock: True                       # default=False, True shows clock overlay. False does not show clock overlay
  clock_justify: "R"                     # default="R", clock justification L, C, or R
  clock_text_sz: 40                      # default=120, clock character size
  clock_format: "%a - %b %d %H:%M"       # default="%I:%M", strftime format for clock string

To activate the clock feature, set show_clock to True. Everything after the # on those lines is a comment telling you what the default would be — it is not part of the setting, so clock_text_sz: 40 really is 40 even though the comment next to it says 120.

You can position the clock either left (L), right (R), or center (C) at the top of the photo.

Play around with the font size so that it is not big but still easy to read for you.

Regarding the format, you have a lot of choices and you can find full documentation here.

You can either just show the time, date, 12/24 format, day of the week, etc. to make it just right for your needs.

Here are three examples:

“Monday, Dec 27, 2021” is

clock_format: "%A, %b %d, %Y"

“14:48:15”

clock_format: "%H:%M:%S"

or in 12h time format “3:00:31 pm”

clock_format: "%r"

The clock on picframe3

On a Raspberry Pi 4 or 5 I now run picframe3, which has no configuration.yaml. The clock is a card on the settings page of the frame's own web interface, and the settings behind it are:

viewer.show_clock       on or off
viewer.clock_format     strftime, e.g. "%H:%M" or "%-I:%M %p"
viewer.clock_size       type size in pixels at 1080p (default 120)
viewer.clock_position   TL, TC, TR, BL, BC or BR
viewer.clock_opacity    0 to 1
viewer.clock_offset_pct how far in from the corner, across and down

Two differences worth knowing: picframe3 can put the clock along the bottom of the picture as well as the top, and the date a photo was taken is a separate thing from the clock — it is one of the caption elements in viewer.show_text, formatted with viewer.date_format. The format strings are the same strftime codes as above.

Conclusion

If you place your Raspberry Pi photo frame on a desktop, showing the time and/or date is a feature that many people like to have. It’s probably less relevant for large wall-mounted frames but having the option is nice.