We are celebrating the 10-year anniversary of the Alteryx Community! Learn more and join in on the fun here.
Start Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.
SOLVED

Query regarding format of date using DateTimeToday function

Mohd-Siddiqui1
8 - Asteroid

Hi there,

 

I have below stated query. Can someone please help me on this.

 

I am using one website for fetching data, but before fetching data I need to make some automatic changes in the URL.

 

website: httpabcdeDate_Effec=20220531xyzdate1=2022-01-31hellothisisadummyURLdate2=2022-03-10

 

I want Date_Effec (present in above URL) to get updated every day with current day's date. 

I am using DateTimeToday function and I am able to update the Date_Effec with current day's date but format is not matching.

 

Output I am getting using DateTimeToday: httpabcdeDate_Effec=2022-08-23xyzdate1=2022-01-31hellothisisadummyURLdate2=2022-03-10

 

Expected Output: httpabcdeDate_Effec=20220823xyzdate1=2022-01-31hellothisisadummyURLdate2=2022-03-10

 

2 REPLIES 2
DataNath
17 - Castor
17 - Castor

Hey @Mohd-Siddiqui1, you’ll need to wrap DateTimeToday() in your desired format which in this case is YYYYMMDD. To do this you can use:

 

DateTimeFormat(DateTimeToday(), '%Y%m%d')

 

Or you could just use simple string functions like Replace() to remove the hyphens as your date is otherwise in the correct format:

 

Replace(DateTimeToday(),'-','')

 

DataNath_0-1661265701670.png

Mohd-Siddiqui1
8 - Asteroid

Hi @DataNath 

Thank you for the help.

Labels
Top Solution Authors