Read Datetime from txt File For X axis

Hello;
I have datetime my txt file like this:
2010-May-01/00:30:00.000
gunler.txt (3.4 KB)
And my graph x axis shoul created for this txt file
How can read it and draw it

What does the rest of your data look like? You may need to convert the first column to something ROOT understands. I’m not sure ROOT will be able to read your dates in this particular format.

You can use strptime:

tm t;
if (!strptime("2010-May-01/00:30:00.000", "%Y-%b-%d/%H:%M:%S.000", &t)) { 
   // FAILED, handle error
} else {
   // the timestamp is in variable t
}

https://root.cern.ch/how/how-create-axis-time-units

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.