I have a list of dates (strings) from a delimited text file. All of these times are UTC. E.g 3 seconds past midnight on 1st July UTC
raw_time = 2022-07-01 00:00:03
I have converted this to a date using
my_time = new Date(raw_time)
I wish to test if the dates fall within a range
e.g.
Fri, 01 Jul 2022 00:00:00 GMT
to
Sun, 31 Jul 2022 23:59:59 GMT
The example fails because when I look at
my_time.toUTCString()
I get the result
Thu, 30 Jun 2022 23:00:03 GMT
I should add that I am in the UK on BST (GMT+1)
How can I force the raw date to be converted as a UTC date?