# How to set the annotate time as date time format

**URL:** https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348
**Category:** ParaView Support
**Created:** [May 18, 2020, 12:01am UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348 "2020-05-18T00:01:44Z")
**Posts on this page:** 15
**Page:** 1

<div class="post-metadata">

### Author: ![Changzhi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@Changzhi](https://discourse.paraview.org/u/Changzhi)
#### Post date: [May 18, 2020, 12:01am UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/1 "2020-05-18T00:01:44Z")

</div>

Hello everyone!  
I have 16 VTK files which just contain the 3D point data. The time interval of these files is 15 minutes. But when I play the annimation, the annotate time is from 1 to 16 seconds. How can I set the annotate time format as “18:00 UT”?  
I found a few answers, but they are all about NetCDF files.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 18, 2020, 1:02am UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/2 "2020-05-18T01:02:44Z")

</div>

TemporalShiftScale filter should do the trick.

---

<div class="post-metadata">

### Author: ![Changzhi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@Changzhi](https://discourse.paraview.org/u/Changzhi)
#### Post date: [May 18, 2020, 2:44pm UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/3 "2020-05-18T14:44:33Z")

</div>

But the annotate time in paraview is decimal and date time is sexagesimal. How could transform the timesteps into sexagesimal?  
And I also want to show the text “UT”, not just the numbers. Is it possible to show the datetime format like python?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 19, 2020, 1:56am UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/4 "2020-05-19T01:56:42Z")

</div>

> How could transform the timesteps into sexagesimal?

Unsupported.

> I also want to show the text “UT”, not just the numbers. Is it possible to show the datetime format like python?

Actually, I misunderstood your question.

In order to show the correct annotate time, you will have to do it manually.

1. Compute the right numeric values in a PythonCalculator or a ProgrammableFilter (sexagesimal)
2. Use AnnotateAttributeData to show it with the correct formatting

---

<div class="post-metadata">

### Author: ![Changzhi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@Changzhi](https://discourse.paraview.org/u/Changzhi)
#### Post date: [May 19, 2020, 2:46am UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/5 "2020-05-19T02:46:31Z")

</div>

Is there any examples for this? I tried the Annotate Attribute Data filter, but in “select input arrary” , just “Pressure” can be selected. Do I need to link the numeric values to my data? I am a beginner of paraview, I’m totally confued by these operations.  
Besides, after I checked the “axes grid” box, there is a gray axis in my annimation as the following figure shows. I checked all the iterms in axes grid, but I didn’t find any thing about the gray axis. do you know how to remove it?  
Thank you  
 ![image](https://discourse.paraview.org/uploads/default/original/2X/9/9207688222a02a78fd3ee163f67038225e9ce7c0.jpeg)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 19, 2020, 2:58am UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/6 "2020-05-19T02:58:52Z")

</div>

> Is there any examples for this? I tried the Annotate Attribute Data filter, but in “select input arrary” , just “Pressure” can be selected. Do I need to link the numeric values to my data?

Yes, you need to generate the correct sexagesimal data using the timesteps in a ProgrammableFilter, here is how it could look like :

- Filters → ProgrammableFilter

Then copy this in the script and implement the conversion :

```
pdo = self.GetOutput()
sexaTime = vtk.vtkStringArray()
sexaTime.SetName("SexaTime")
t = inputs[0].GetInformation().Get(vtk.vtkDataObject.DATA_TIME_STEP())
timeAsAString = f(t) #compute your time here in python in a string format
sexaTime.InsertNextValue(timeAsString)
pdo.GetFieldData().AddArray(sexaTime)

```

- Filters → AnnotateAttributeData
- Format your annotation as you wish

---

<div class="post-metadata">

### Author: ![Changzhi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@Changzhi](https://discourse.paraview.org/u/Changzhi)
#### Post date: [May 19, 2020, 3:29am UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/7 "2020-05-19T03:29:22Z")

</div>

What’s the type of “convertedTime” ? It seems I can not set the values of convertedTime directly. If I have to use t to compute time, it’s impossible to get sexagesimal numbers.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 19, 2020, 3:49am UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/8 "2020-05-19T03:49:48Z")

</div>

Indeed, I’ve edited my post.

---

<div class="post-metadata">

### Author: ![Changzhi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@Changzhi](https://discourse.paraview.org/u/Changzhi)
#### Post date: [May 19, 2020, 1:30pm UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/9 "2020-05-19T13:30:26Z")

</div>

OK, that works. Thank you Mathieu.  
Do you know how to remove the gray axis? This really bothers me.

![image](https://discourse.paraview.org/uploads/default/original/2X/9/9110ea97161669a66072463bcbd35d68644b4509.jpeg)

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 20, 2020, 4:41am UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/10 "2020-05-20T04:41:23Z")

</div>

When does this grey artifacts appear ? Please share steps to reproduce.

---

<div class="post-metadata">

### Author: ![Changzhi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@Changzhi](https://discourse.paraview.org/u/Changzhi)
#### Post date: [May 22, 2020, 1:06am UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/11 "2020-05-22T01:06:51Z")

</div>

I was using Windows 10 and paraview 5.8. I opened a vtk files group. After I checked the “Axes Grid” box, it appeared. Now I switched to paraview 5.7 and it didn’t occur.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 22, 2020, 2:45am UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/12 "2020-05-22T02:45:37Z")

</div>

Unable to reproduce here, can you share file to reproduce the issue ?

---

<div class="post-metadata">

### Author: ![Changzhi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@Changzhi](https://discourse.paraview.org/u/Changzhi)
#### Post date: [May 22, 2020, 2:49am UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/13 "2020-05-22T02:49:46Z")

</div>

I am sorry, it’s a part of supporting information of an article which just submitted. Maybe I can share after the publication.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [May 25, 2020, 2:36am UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/14 "2020-05-25T02:36:23Z")

</div>

What type is your data ?

Can you try and reproduce with a shareable dataset ?

---

<div class="post-metadata">

### Author: ![Changzhi](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@Changzhi](https://discourse.paraview.org/u/Changzhi)
#### Post date: [May 27, 2020, 3:48pm UTC](https://discourse.paraview.org/t/how-to-set-the-annotate-time-as-date-time-format/4348/15 "2020-05-27T15:48:38Z")

</div>

Sorry for the late reply. I used a shared matlab script to export my data to vtk files.  
I exported a list of vtk files which includes random values using the same script. I’m not sure whether these files can reproduce the grey artifacts. The matlab script is uploaded and please find the vtk files in the following link  
[vtk files](https://drive.google.com/drive/folders/1OhtIYI1JiKvpCxJqJG4ytVNfhr0-Yq4n?usp=sharing)  
[Mat2VTK.m](https://discourse.paraview.org/uploads/short-url/xqRxAz82fXIkSFiMdgVr0NaLkTh.m) (2.4 KB)
