Closed raytiley closed 4 months ago
@teresasanders77 - think this will work? Seems a bit simpler?
@teresasanders77 - think this will work? Seems a bit simpler?
Looks like that works! When I log the conversions, this is what I get:
[25-Jun-2024 23:10:10 UTC] Original runDateTime for item ID 183067: 2024-06-22 21:30:00
[25-Jun-2024 23:10:10 UTC] UTC runDateTime for item ID 183067: 2024-06-23 01:30:00
[25-Jun-2024 23:10:10 UTC] WordPress runDateTime for item ID 183067: 2024-06-22 18:30:00
And verifying the conversions with ChatGPT, this is the answer:
Given that the original runDateTime is in the New York timezone (Eastern Daylight Time, which is UTC-4 during daylight saving time), we can verify the conversions:
Original runDateTime in New York (EDT): 2024-06-22 21:30:00 (UTC-4) UTC runDateTime: 2024-06-23 01:30:00 (UTC) WordPress runDateTime in Los Angeles (PDT): 2024-06-22 18:30:00 (UTC-7) Let's break down the conversions:
New York to UTC:
New York (EDT) is UTC-4. Therefore, 2024-06-22 21:30:00 + 4 hours = 2024-06-23 01:30:00 UTC. This conversion is correct. New York to Los Angeles:
Los Angeles (PDT) is UTC-7. The difference between New York (EDT) and Los Angeles (PDT) is 3 hours. Therefore, 2024-06-22 21:30:00 - 3 hours = 2024-06-22 18:30:00 PDT. This conversion is also correct. Thus, both conversions shown in your logs are correct.
On retreiving dates from the datbase, convert them to wp timezone.