Re: Java UTC Calendar and Mysql TimeStamp - Gets me every time!!!!!

2013-08-22 Thread Nick Cameo
On Wed, Aug 21, 2013 at 10:39 PM, h...@tbbs.net wrote: 2013/08/21 18:03 -0400, Nick Khamis We have the following mysql timetampe field startdate | timestamp | NO | | -00-00 00:00:00 When trying to insert a long value in there: Calendar c =

Re: Java UTC Calendar and Mysql TimeStamp - Gets me every time!!!!!

2013-08-22 Thread Nick Cameo
Sorry, as was mentioned earlier: select FROM_UNIXTIME(1377196112065/1000); +---+ | FROM_UNIXTIME(1377196112065/1000) | +---+ | 2013-08-22 18:28:32 | +---+ Have a good day everyone :)

Re: Java UTC Calendar and Mysql TimeStamp - Gets me every time!!!!!

2013-08-22 Thread hsv
2013/08/22 14:22 -0400, Nick Cameo SimpleDateFormat sdf = new SimpleDateFormat(-MM-dd'T'HH:mm:ss, new Locale(en, US)); Well, you have your answer (FROM_UNIXTIME( /1000)), but that stupid ISO format with 'T' in the middle does not work, because to MySQL letters are not

Java UTC Calendar and Mysql TimeStamp - Gets me every time!!!!!

2013-08-21 Thread Nick Khamis
Hello Everyone, We have the following mysql timetampe field startdate | timestamp | NO | | -00-00 00:00:00 When trying to insert a long value in there: Calendar c = Calendar.getInstance(TimeZone.getTimeZone(UTC)); c.getTimeInMillis(); We are presented with the following error:

Re: Java UTC Calendar and Mysql TimeStamp - Gets me every time!!!!!

2013-08-21 Thread Michael Dykman
Nick, You should have answered your own question in the text. The MySql TIMESTAMP type is, as all other timestamps in the *nix world, a count of seconds since epoch time. The Java function you are using yields MILLI-seconds. Divide it by 1000 and you should be good to go. On Wed, Aug 21,

Re: Java UTC Calendar and Mysql TimeStamp - Gets me every time!!!!!

2013-08-21 Thread hsv
2013/08/21 18:03 -0400, Nick Khamis We have the following mysql timetampe field startdate | timestamp | NO | | -00-00 00:00:00 When trying to insert a long value in there: Calendar c = Calendar.getInstance(TimeZone.getTimeZone(UTC)); c.getTimeInMillis(); We are presented with the