on 10-25-2005 10:41 AM
Dear all ,
I have a query related to variable substitution :
The requirement is that filename should be in the following format : <b>%<store_code>%_%<Date>%</b>_master.xml .
I have done the configuration for Store_code in the variable substitution from Payload .
But I am facing <b>problem related to Date as the requirement is that we should not take the date from the payload</b> . We used "ADDtimestamp" in the file mode creation but it is generating file with time stamp also which doesn;t serve the purpose .
Can somebody suggest <b>how to take the current date without taking it from payload .</b> <b>Does anyone know something about standard current date which I can assign directly to Var2 .</b>
Thanks in advance
Regards
Prabhat
Hi,
In your mapping, have a user defined function which has a bit of Java to get the current date and time and pass back out to a variable.
Here is a code snippet I got in Google to do this :
import java.text.*;
import java.util.*;
public class Dtest {
public static void main(String args[]) {
SimpleDateFormat df = (SimpleDateFormat)
DateFormat.getDateInstance(DateFormat.SHORT);
System.out.println("The short date format is " + df.toPattern());
Locale loc = Locale.ITALY;
df = (SimpleDateFormat)
DateFormat.getDateInstance(DateFormat.SHORT, loc);
System.out.println("The short date format is " + df.toPattern());
}
}
Cheers
Colin.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.