From: <php...@li...> - 2007-05-12 20:39:17
|
Thanks for the prompt reply, Jost. The issue I am facing with is that time() or gmmktime() returns unix timestamp with just 10 digits e.g. 1178999783 whereas, java timestamp is expecting 13 digits. Assume time() returned 1178999783, I believe this php line=20 Java('java.sql.Timestamp', time()); Is equivalent to this line in java new Timestamp(0001178999783); As the result, the timestamp became incorrect on my back end server. My temporary resolution was to multiply whatever returned by php time() by 1000. What is your suggestion? Thanks=20 -----Original Message----- From: php...@li... [mailto:php...@li...] On Behalf Of php...@li... Sent: Saturday, May 12, 2007 10:30 AM To: php...@li... Subject: Re: [Php-java-bridge-users] php to java timestamp Hi, > $startDate =3D new Java('java.sql.Timestamp', > gmmktime(0,0,0,10,3,2007)); > $endDate =3D new Java('java.sql.Timestamp', time()); > 1970-01-14 10:56:09.6 > 1970-01-14 07:29:12.32 depending on what gmmktime() and time() return, the above results are correct. Both, time() and gmmktime() must return a java.lang.long, a 64bit value representing the seconds since some time in the history. Please see the sql.Timestamp API documentation for details. Regards, Jost Boekemeier __________________________________ Yahoo! Clever - Der einfachste Weg, Fragen zu stellen und Wissenswertes mit Anderen zu teilen. www.yahoo.de/clever ------------------------------------------------------------------------ - This SF.net email is sponsored by DB2 Express Download DB2 Express C - the FREE version of DB2 express and take control of your XML. No limits. Just data. Click to get it now. http://sourceforge.net/powerbar/db2/ _______________________________________________ php-java-bridge-users mailing list php...@li... https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |