Get the month before the current month

Highlighted
One Star

Get the month before the current month

Hi there,
I have the following code which I'm trying to use to rename a file in the tFTPPut component: "NEW-NAME-01-"+TalendDate.addDate(TalendDate.getDate("MMM-YY"),"MMM-YY",-1,"MM")+".txt"
However, the file name I get returned is NEW-NAME-01-Nov-13.txt; very strange. 
I want it to be like NEW-NAME-01-Oct-14.txt.
Thanks,
Facoda
Four Stars

Re: Get the month before the current month

HI HI HI HI
It's 
"NEW-NAME-01-"+TalendDate.addDate(TalendDate.getDate("MMM-YY"),"MMM-yy",-1,"MM")+".txt"
not
"NEW-NAME-01-"+TalendDate.addDate(TalendDate.getDate("MMM-YY"),"MMM-YY",-1,"MM")+".txt"

I changed YY to yy

15TH OCTOBER, COUNTY HALL, LONDON

Join us at the Community Lounge.

Register Now

2019 GARNER MAGIC QUADRANT FOR DATA INTEGRATION TOOL

Talend named a Leader.

Get your copy

OPEN STUDIO FOR DATA INTEGRATION

Kickstart your first data integration and ETL projects.

Download now

What’s New for Talend Summer ’19

Watch the recorded webinar!

Watch Now

Best Practices for Using Context Variables with Talend – Part 4

Pick up some tips and tricks with Context Variables

Blog

How Media Organizations Achieved Success with Data Integration

Learn how media organizations have achieved success with Data Integration

Read

Definitive Guide to Data Quality

Create systems and workflow to manage clean data ingestion and data transformation.

Download