0

The figure picture! Just like the picture, how can i format the number to datetime pattern. For example format 1472860800.0 to 2016-09-03.It can't use the datetime module to format directly. The key point is that it should be formatted in the matplotlib firgure. It is a slider value, and i have read the matplotlib docs ,but i haven't found the sloution.Thanks!

1 Answers1

-1

Use datetime module

>>> from datetime import datetime
>>> datetime.fromtimestamp(1472860800).strftime("%Y-%m-%d")
'2016-09-03'
Abdulafaja
  • 262
  • 2
  • 8
  • I kown the datetime module. The key point is that it should be formatted in the matplotlib firgure. It is slider value, and i have read the matplotlib docs ,but i haven't found the sloution. – Cavscoding Sep 06 '16 at 07:56
  • Look on [this](http://stackoverflow.com/questions/13656387/can-i-make-matplotlib-sliders-more-discrete), I think it is going to be helpful – Abdulafaja Sep 06 '16 at 08:04