I have a time dependent data set where each frame corresponds to a certain date. I need to show the time annotation, much like what Annotate Time Filter does, but show the date instead of time as a float value. How can I do that?

In python I can convert the time index to a date with datetime for instance:

init_date = datetime.datetime(2018, 1, 1)
time_step = 3600.
itime = 20
date = init_date + datetime.timedelta(seconds=itime*time_step)
print(date.strftime('%Y-%m-%d %H:%M'))
  • $\begingroup$ You can record a script and then check the code. $\endgroup$ – nicoguaro Aug 21 '18 at 12:44
  • $\begingroup$ I can use Tools->Start Trace to get Python code for creating an annotation filter. However, it will just show a call to AnnotateTimeFilter(Input=...). I'd need to modify the filter itself or create a Programmable filter that modifies its output. $\endgroup$ – teekarna Aug 21 '18 at 13:05
  • $\begingroup$ I just checked the last ParaView Guide and it has several material on using ParaView through Python. $\endgroup$ – nicoguaro Aug 21 '18 at 16:21
  • $\begingroup$ You are still not answering the question... $\endgroup$ – teekarna Aug 21 '18 at 19:34

Did you get an answer? I have a similar question. I have added a time filter and tweaked the settings as shown below.

I would like it formatted as 12:00 9 Feb 2017 (or anything similar) My quick fix got me 9.5 Feb 2017 using Scale = 1.157e-05 (=1/60/60/24) Shift = -17197 (jump to the first frame and set as the negative) Format = %4.2f Feb 2017

This works ok as a decimal input but it's going into a publication and I need to do better (multiple days so similar trick on hours won't work).


  • $\begingroup$ @Miles: Hi Miles and welcome to scicomp. Unlike other online forums, we operate strictly on a question and answer basis (with room for comments to clarify q's and a's). The space where you have written your response is reserved for answers to the posted question only. If you have a related (but different) question, I recommend posting it as a separate question rather than as a response to someone else's question. $\endgroup$ – Paul Oct 11 at 3:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.