0

I'm looking to generate a .png image with a dynamic date, ex:

take today's date +7 days and create a .png that displays that date.

I'd like to keep the .png name the same and just overwrite once a week, always showing the date + 7 from that one day a week.

site.com/img/date.png

Is this possible?

M21
  • 343
  • 3
  • 14

2 Answers2

1

If you have the GNU date command, you can get the date 7 days from now with:

date -d '+7 days'

You could then pump that, or whatever parts of it you want into the script in my other answer here.

You don't say how you want it formatted, but that script comes up like this:

enter image description here

Community
  • 1
  • 1
Mark Setchell
  • 191,897
  • 31
  • 273
  • 432
0

Imagemagick can do this fairly easily and is easy to have it run as a cronjob for automatic generation.

Nathan
  • 366
  • 1
  • 6