cancel
Showing results for 
Search instead for 
Did you mean: 

Adding time stamp to the field

Former Member
0 Kudos

Hi,

All

I need to pass the Current Date and Time Stamp to the Target Field

For Current Date there is a Standard Function Is There ,For Time stamp Is there any Standard Function is there or we Need to write write UDF ,if we need to write to UDF Please provid Java Code for that.

Marks is awardble

Thnx in advance

Regards

kumar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Use this piece of code to get the current time.

Calendar cal = new GregorianCalendar();

int intHour24 = cal.get(Calendar.HOUR_OF_DAY); // 0..23

int intMin = cal.get(Calendar.MINUTE); // 0..59

int intSec = cal.get(Calendar.SECOND); // 0..59

String strTime = intHour24":"intMin":"intSec;

return strTime;

Regards,

Jai Shankar

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi,

You can use the standard function currentDate.Right click and select properties.Provide the target format as HHmmSS.

Regards,

Smitha.

former_member189558
Contributor
0 Kudos

Kumar,

<b>The standard function can handle both Date and time.</b>

Just double click on the function to open the properties.. you will find there are options for time as well..

Cheers,

Himadri

Former Member
0 Kudos

Hi,

Using this java code you can get both Date and Time...

import java.util.Date;

Date d = new Date();

return d.toString();

The format returned will be like this "Tue Dec 26 12:15:24 IST 2006"

To change the format, you can use get methods( getDate(), getHours() ) of Date class and concatenate them.

Regards,

Uma