X Axis on Line graph incorrect

As I begin to create a dashboard (using Powershell mainly) I have started with pulling in data from several CSVs and creating a line graph. As far as I can tell, this data has a valid timestamp column ( in the format MM-dd-yyyy HH:mm:ss) and valid value and label columns.

The data starts plotting from left to right on the line graph. And it is updating. However, the X axis times are entirely wrong. For instance, I am collecting this data every 5 minutes. It is currently 7:30 PM here, but the line graph is showing 3 PM for the data points. Is this due to UTC vs my current time zone? If so, what do I do to fix this?

Some example response data:

timestamp                value label       
---------                ----- -----       
8/12/2022 7:03:37 PM  1.898734 CPU Core #01
8/12/2022 7:07:33 PM  1.931613 CPU Core #01
8/12/2022 7:08:37 PM         0 CPU Core #01
8/12/2022 7:13:37 PM     0.625 CPU Core #01
8/12/2022 7:18:37 PM         0 CPU Core #01
8/12/2022 7:23:37 PM         0 CPU Core #01
8/12/2022 7:28:37 PM  3.797468 CPU Core #01
8/12/2022 7:03:37 PM  1.265823 CPU Core #02
8/12/2022 7:07:33 PM  1.923077 CPU Core #02
8/12/2022 7:08:37 PM         0 CPU Core #02
8/12/2022 7:13:37 PM         0 CPU Core #02
8/12/2022 7:18:37 PM         0 CPU Core #02
8/12/2022 7:23:37 PM     3.125 CPU Core #02
8/12/2022 7:28:37 PM  3.797468 CPU Core #02
8/12/2022 7:03:37 PM 0.6329114 CPU Core #03
8/12/2022 7:07:33 PM  1.931613 CPU Core #03
8/12/2022 7:08:37 PM         0 CPU Core #03
8/12/2022 7:13:37 PM 0.6329114 CPU Core #03

Sounds like a probable cause. I can’t find any mention of it specifically in the docs (though I didn’t look hard).

If this is the case and you have a DateTime class, you should be able to convert it easily enough:

$Date.ToUniversalTime()

One of the things that sometimes bites me is the ‘Kind’ of time you have. The conversion methods do sometimes make some blind assumptions, particularly if the kind is unknown (best practice is to explicitly set it each time, but some sources don’t or other things get in the way). If you run into trouble the .Net datetime class docs go into more details, but you can quickly query what kind you are working with from the DateTime object itself:

$Date.kind
Local