From: <php...@li...> - 2010-11-16 08:21:27
|
Hi I have a java class that return a date. I would like to use the java DateFormatter class to format the date, but it gives me an error. Sample: $hello= new java("mytest.services.MyService"); $date=java_values($hello->mydate); $df = new JavaClass('java.text.DateFormat'); $formater = $df->getDateInstance($df->SHORT); $echo("formater->format($date"); Result is: Uncaught [[o:Exception]:"java.lang.Exception: GetProperty failed: [[o:SimpleDateFormat]]->format. Cause: java.lang.NoSuchFieldException: format (with args:) But the DateFormat class does have a format method. Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
From: <php...@li...> - 2010-11-16 20:03:21
|
Hi, please double check your php code. You access an attribute where you should have called a method. Php is an insane programming language, so you may run into unexpected errors if you aren't careful. Regards, Jost Bökemeier Am 16.11.2010 09:21 schrieb <php...@li...>: > Hi > > I have a java class that return a date. I would like to use the java > DateFormatter class to format the date, but it gives me an error. > > Sample: > > $hello= new java("mytest.services.MyService"); > $date=java_values($hello->mydate); > $df = new JavaClass('java.text.DateFormat'); > $formater = $df->getDateInstance($df->SHORT); > $echo("formater->format($date"); > > Result is: Uncaught [[o:Exception]:"java.lang.Exception: GetProperty > failed: [[o:SimpleDateFormat]]->format. Cause: > java.lang.NoSuchFieldException: format (with args:) > > But the DateFormat class does have a format method. > > > Hermod > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > > This email with attachments is solely for the use of the individual or > entity to whom it is addressed. Please also be aware that the DnB NOR Group > cannot accept any payment orders or other legally binding correspondence with > customers as a part of an email. > > This email message has been virus checked by the anti virus programs used > in the DnB NOR Group. > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today > http://p.sf.net/sfu/msIE9-sfdev2dev > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
From: <php...@li...> - 2010-11-17 05:55:38
|
Hi I am unsure what you are referring to. The way to format a date with DateFormat is to call the format method. So is $dateformat->format($mydate); not a method call in PHP? Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
From: <php...@li...> - 2010-11-17 06:08:39
|
Not if you quote it, as shown in your previous example. Am 17.11.2010 06:56 schrieb <php...@li...>: > Hi > > I am unsure what you are referring to. The way to format a date with > DateFormat is to call the format method. > > So is $dateformat->format($mydate); not a method call in PHP? > > Hermod > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > > This email with attachments is solely for the use of the individual or > entity to whom it is addressed. Please also be aware that the DnB NOR Group > cannot accept any payment orders or other legally binding correspondence with > customers as a part of an email. > > This email message has been virus checked by the anti virus programs used > in the DnB NOR Group. > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today > http://p.sf.net/sfu/msIE9-sfdev2dev > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users |
From: <php...@li...> - 2010-11-17 06:31:50
|
Hi This may be stupid, but could you be more specific? mvh Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
From: <php...@li...> - 2010-11-17 06:36:28
|
Hi, This is a php issue, not a java bridge issue, so using this mailing list is not really appropriate. Please refer to the php data function : http://php.net/manual/en/function.date.php, or using the DataTime object : http://www.php.net/manual/en/datetime.format.php The correct syntax would be $formattedDate = date($format, $timestamp) or (object, assuming you variable $dateformat is a DateTime object) $formattedDate = $dateformat->format($format), with $format being a format string like 'Y-m-d H:i:s' Regards, J. Mallet. On Wed, Nov 17, 2010 at 1:55 PM, < php...@li...> wrote: > Hi > > I am unsure what you are referring to. The way to format a date with > DateFormat is to call the format method. > > So is $dateformat->format($mydate); not a method call in PHP? > > Hermod > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > > > |
From: <php...@li...> - 2010-11-17 06:43:19
|
Hi PHP Issue? I thought I was working with Java classes here. I'll have a look at the PHP date classes. What I have been trying to do is use the TavaBridge with the Java DateFormat class. It seems to me that that is not possible? Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
From: <php...@li...> - 2010-11-17 06:52:25
|
Well, I am almost sure that if you use the syntax $dateformat->format($mydate); as you mentioned, you are working with PHP classes and methods. You have instantiated your object with a Java class, but everything after is PHP as far as I know (you are using $ and '->') I am a php developer and used the java-bridge only to run php code on a tomcat server, so I might be wrong here, but you are trying to call a format member in php which I believe doesn't exist. Regards, J Mallet. On Wed, Nov 17, 2010 at 2:43 PM, < php...@li...> wrote: > Hi > > PHP Issue? I thought I was working with Java classes here. I'll have a > look at the PHP date classes. What I have been trying to do is use the > TavaBridge with the Java DateFormat class. It seems to me that that is > not possible? > > Hermod > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > > This email with attachments is solely for the use of the individual or > entity to whom it is addressed. Please also be aware that the DnB NOR Group > cannot accept any payment orders or other legally binding correspondence > with > customers as a part of an email. > > This email message has been virus checked by the anti virus programs used > in the DnB NOR Group. > > * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > > > > ------------------------------------------------------------------------------ > Beautiful is writing same markup. Internet Explorer 9 supports > standards for HTML5, CSS3, SVG 1.1, ECMAScript5, and DOM L2 & L3. > Spend less time writing and rewriting code and more time creating great > experiences on the web. Be a part of the beta today > http://p.sf.net/sfu/msIE9-sfdev2dev > _______________________________________________ > php-java-bridge-users mailing list > php...@li... > https://lists.sourceforge.net/lists/listinfo/php-java-bridge-users > -- Julien Mallet Infopower Consultant +86 150 00 201 802 |
From: <php...@li...> - 2010-11-17 07:04:00
|
Hi And I am just the oppsite - A Java programmer comming into the PHP world (Due to Joomla) I'll dig into this. It might be a syntactical problem here - I thought the JavaBridge was ment to enable my Java classes in PHP, which it also does. But in this case it is a mix of instance and static methods. Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |
From: <php...@li...> - 2010-11-17 20:37:30
|
>From your code: echo("formater->format($date"); The error message is correct, I think |
From: <php...@li...> - 2010-11-18 06:54:43
|
Hi Yeah - That might just be it. Thanks, Hermod * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * This email with attachments is solely for the use of the individual or entity to whom it is addressed. Please also be aware that the DnB NOR Group cannot accept any payment orders or other legally binding correspondence with customers as a part of an email. This email message has been virus checked by the anti virus programs used in the DnB NOR Group. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |