Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 8950

Re: Need UDF for Datum Timestamp

$
0
0

Hi Vijay,

 

For this output MM:DD:YY-T-HH:MM:SS try below code

 

Date date;
String output = "";
SimpleDateFormat sdfSource  = new SimpleDateFormat("MMddyyHHmm");
SimpleDateFormat sdfDestination = new SimpleDateFormat("MM-dd-yy");
SimpleDateFormat stfSouce = new SimpleDateFormat("MMddyyHHmm");
SimpleDateFormat stfDestination = new SimpleDateFormat("HH:mm:ss");
try{
date =  sdfSource.parse(sDate);
String TDate= sdfDestination.format(date);
date = stfSouce.parse(sDate);
String Ttime = stfDestination.format(date);
output = TDate +"-T-"+Ttime;
}catch(Exception e){
}

    return output;

 

Regards,

Krupa

 

code updated.. Message was edited by: Krupa Rao Atluri


Viewing all articles
Browse latest Browse all 8950

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>