[classad-users] Time value representation


Date: Thu, 31 Oct 2002 07:29:45 -0600 (CST)
From: Alessandro Maraschini <alessandro.maraschini@xxxxxxxxxx>
Subject: [classad-users] Time value representation
Hi all,
We are using both java and c++ ClassAd package/library but we get into
an inconsintence-like problem while managing time values.
In C++ in fact a time value is represented as a string by single quotes
(i.e. 'Fri Oct 25 13:37:26 2002 (CEST) 01:00') whilest in the Java
package it seems to be implemented like a simple string without any quotation.
This dual approach unfortunately causes to us serious problem because we're
sending the classad string representation to a server who doesn't know
which is the used language used. As far as you know is there any solution
for this? is this going to be fixed or it has been done on purpose?
here follows a simple example:
C++ source:
   classad::ClassAd classAd ;
   classAd.Insert( "ATTRIBUTE" , Literal::MakeAbsTime( 
) ) ;
   string      
buffer="";
   PrettyPrint  unp;
   unp.Unparse(buffer, &classAd );
   cout << buffer;
And the output is:
[
        ATTRIBUTE
= 'Thu Oct 31 14:15:09 2002 (CET) 01:00'
]
Java Source:
    RecordExpr re = new RecordExpr() ;
    re.insertAttribute( "ATTRIBUTE" ,
(Expr) Constant.getInstance(   new Date(   ) 
)  );
    System.out.println( re) ;
And the output is:
[ ATTRIBUTE = Thu Oct 31 14:25:02 CET 2002 ]


-- 
=============================================================
Alessandro Maraschini
GRID R&D Group
Defence, Space & Environment Division
DATAMAT S.p.A.
Via Laurentina, 760 -I- 00143 Rome - Italy
http://www.datamat.it
mailto:alessandro.maraschini@xxxxxxxxxx
Phone: +39 06 5027 4501 (direct) +39 06 5027 4570 (secretary)
Fax: +39 06 5027 4500
=============================================================
 


[← Prev in Thread] Current Thread [Next in Thread→]