I've seen on other posts that the root cause of my issue is time zones and the fact Timestamp.valueOf() uses time zones. How do I get valueOf to use the correct time zone?
This java test fails:
public void runTimestampTest()
{
String timeString = "2019-03-10 02:01:33.242000";
Timestamp timestamp = Timestamp.valueOf(timeString);
System.out.println("timeString = " + timeString);
System.out.println("timestamp = " + timestamp);
assertEquals(timeString, timestamp.toString());
}
the timestamp I get is "2019-03-10 03:01:33.242". When I get the default time zone it's 'America/Denver'. If I iterate all time zones and get the zone with raw offset equal to the ZONE_OFFSET I get 'America/Boise'. How do I get these to match? TimeZone.setDefault() doesn't fix it.
I can't seem to get a timestamp with the correct value and I have to use a Timestamp class to pass to another API.
Thanks, -Mike