I am trying to convert a string date value in java to date and trying to store it in a mysql table.
Below the code snippet:
DateFormat dfm = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss");
String string = "07/24/2013 17:57:52 UTC";
Date a = dfm.parse(string);
System.out.println(a);
My problem is that the above code always returns the following console output: Wed Jul 24 17:57:52 PDT 2013
I don't know why the time zone is getting changed, more over when I am trying to put this into the database then it is storing it in '2013-07-24 17:57:52' format. I am not sure why the above code is returning me timezone in PDT?
Can you guys please explain me that? My intent is to store a UTC date which will come as an input and store it into the MySQL timestamp field.
Thanks in Advance.