webMethods

webMethods

Join this online group to communicate across IBM product users and experts by sharing advice and best practices with peers and staying up to date regarding product enhancements.

 View Only
  • 1.  Date formate java program (IST to GMT)

    Posted Fri April 28, 2006 09:05 AM

    Dear friends,

    This is a java program, where is accept date coming from outside. I am converting date object to string to specific date format MM/dd/yyyy hh.mm.ss. Date coming from out is 4/28/2006 12:29:34 IST format but it is giving the result in different format. 04/28/2006 06.59.34
    I need to know why this time is getting converted.
    How to get that same time. 4/28/2006 12:29:34 IST

    Public static void main(IDATAPIPELINE)throws ServerException 
    {
    IDataCursor idc = pipeline.getCursor();
    idc.first("dateObject");
    if(idc.getValue()!=null)
    {
    Date dateObject=(Date)idc.getValue();
    DateFormat df =  DateFormat.getDateInstance();
    DateFormat format3 = new SimpleDateFormat( "MM/dd/yyyy hh.mm.ss" );
    String strDate=format3.format(dateObject);
    idc.insertAfter("dateString", strDate);
    
    }
    
    idc.destroy();
    
    } 

    Input

    4/28/2006 12:29:34 IST

    Out Put: -

    04/28/2006 06.59.34

    Please help me lot. Thanks in advances

    Regards
    Balachandra.k


    #Integration-Server-and-ESB
    #webMethods
    #Flow-and-Java-services


  • 2.  RE: Date formate java program (IST to GMT)

    Posted Fri April 28, 2006 06:26 PM

    Balachanda,

    Why are you doing this in a java service? Try the pub.date:dateTimeFormat built-in service instead.

    Mark


    #Flow-and-Java-services
    #webMethods
    #Integration-Server-and-ESB


  • 3.  RE: Date formate java program (IST to GMT)

    Posted Mon May 01, 2006 04:50 PM

    exactly , the date format service is available in transformers. why dont u use that .


    #webMethods
    #Integration-Server-and-ESB
    #Flow-and-Java-services


  • 4.  RE: Date formate java program (IST to GMT)

    Posted Mon May 01, 2006 05:48 PM

    Your pattern string “MM/dd/yyyy hh.mm.ss” is not correct for the output you want. Research the pattern strings for the pub.date:dateTimeFormat that Mark mentions above (page 66 in the Built-in Services guide for 6.1).


    #webMethods
    #Flow-and-Java-services
    #Integration-Server-and-ESB