cancel
Showing results for 
Search instead for 
Did you mean: 

Need current data and time stamp in Java mapping

Former Member
0 Kudos

Hi All,

I am doing the scenario as file to mail. so here i am using java mappings for sending the file in mail attachment.

I have done my java mappings and its executed successfully. File is going successfully to third party.

Business wants date and timestamp in subject line.

Currently i am using mail subject line as EDI File.

But business needs the date and time in the subject line after EDI File as EDI File <yyyymmddhhmm>.

So my requirement here is adding the date and timestamp.

Can any one suggest how can write java code to acheive.

Thanks

Bhaskar

Thanks,

Bhaskar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Bhaskar,

> Can any one suggest how can write java code to acheive.

Check this below links

http://www.javadb.com/get-current-date-and-time-with-the-simpledateformat-class

http://www.java-tips.org/java-se-tips/java.util/how-to-get-current-date-time.html

http://www.rgagnon.com/javadetails/java-0106.html

After getting the time stamp, you can concatenate the EDI file with timestamp.

Regards

Ramesh

Former Member
0 Kudos

Hi ALL,

My Question is Answered.

Thanks for your inputs.

I have given points 6 each and 2 to one as i can not give 6 to three.

Thanks,

Bhaskar

sunilchandra007
Active Contributor
0 Kudos

Hi Bhaskar,

> Business wants date and timestamp in subject line.

1. Add the import statments at beginning

import java.util.Date;
import java.text.SimpleDateFormat;

2. Add these statments to get timestamp and Concatenate the subject line with string currentdate.

SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmm");
String currentdate = sdf.format(new Date());
subjectline = subjectline.concat(currentdate);

Regards,

Sunil Chandra