Level 1

0% to

Level 2

Tip /

to gain points, level up, and earn exciting badges like the new
Mission!

View all

Convert System Date to mmddyyyy format

alik98709228
Level 2

Likes

3 likes

Total Posts

28 posts

0 solutions
View profile

alik98709228
Level 2

Likes

3 likes

Total Posts

28 posts

0 solutions
View profile
alik98709228
Level 2

25-03-2021

Hello,

I am trying to convert system date to in this format: mmddyyyy

So for today which is March 25th, 2021, it should show as 03252021

I am using the following formula:

Month(GetDate())+'/'+Day(GetDate())+'/'+Year(GetDate())

It worked but the results are coming up in format "3/245/2021". Is there a way, I can get the 2 digits for the month without having the "/". For instance. for today, the output should be: 0325202

Any ideas?

Thanks!

Accepted Solutions (1)

DavidKangni
MVP

Likes

258 likes

Total Posts

372 posts

152 solutions
View profile

DavidKangni
MVP

Likes

258 likes

Total Posts

372 posts

152 solutions
View profile
DavidKangni
MVP

26-03-2021

Iif(Month(GetDate())>9, ToString(Month(GetDate())), '0'+ToString(Month(GetDate())))+Iif(Day(GetDate())>9, ToString(Day(GetDate())), '0'+ToString(Day(GetDate())))+ToString(Year(GetDate()))

Also make sure to post in ACS forum instead of ACC.

Thanks,

David

Or you can simplify the formula slightly:

Right('0'+ToString(Month(GetDate())), 2) + Right('0'+ToString(Day(GetDate())),2) + ToString(Year(GetDate()))

@davidkangini
Hi
Am trying to pass an expiration date through enrichment by concatenating by taking 2variable[variable1||variable2], but after that I am getting the date for
Am trying to pass an expiration date through enrichment by concatenating by taking 2variable[variable1||variable2], but after that I am getting the date format as yyyy-mm-dd, could some one please help me to get the date format as variable_field=ddmmyyyy,

Deb007
Level 4

Likes

50 likes

Total Posts

86 posts

25 solutions
View profile

Deb007
Level 4

Likes

50 likes

Total Posts

86 posts

25 solutions
View profile
Deb007
Level 4

26-03-2021

Hope this will work.

var a = formatDate(new Date(), "%2M%2D%4Y");