cancel
Showing results for 
Search instead for 
Did you mean: 

Convert float to Date

0 Kudos

Dear Friends,

The standard SAP BAPI in use BAPI_OBJCL_GETDETAILS returns the date in float type in the field allocvaluenum the attribute being valuefrom. Would like to know how can i convert this float type into date type to be displayed in the portal.

Thanks and regards

SantoshKumar

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member185086
Active Contributor
0 Kudos

Hi

As I guess Its not a float Its long type

Use below code for this

import java.util.*;
import java.text.*;
public class LongToDate {
   public static void main(String[] args)throws Exception {
      Date date = new Date();
      DateFormat dataformat =  DateFormat.
getDateInstance(DateFormat.LONG);     
      String s4 = dataformat.format(date);
       System.out.println(dataformat.format(date));    
    } }

Best Regards

Satish Kumar