Niveau 1
Niveau 2
Se connecter à la communauté
Connectez-vous pour voir tous les badges
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:
Résolu ! Accéder à la solution.
Vues
Réponses
Nombre de J’aime
Please use this
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
Vues
Réponses
Nombre de J’aime
Hi @alik98709228 ,
Hope this will work.
var a = formatDate(new Date(), "%2M%2D%4Y");
logInfo(a);
You can refer to the following for more details.
Thanks,
Deb
Vues
Réponses
Nombre de J’aime
Please use this
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
Vues
Réponses
Nombre de J’aime
Or you can simplify the formula slightly:
Right('0'+ToString(Month(GetDate())), 2) + Right('0'+ToString(Day(GetDate())),2) + ToString(Year(GetDate()))
Vues
Réponses
Nombre de J’aime
Vues
Réponses
Nombre de J’aime
Vues
Réponses
Nombre de J’aime
Vues
Réponses
Nombre de J’aime
Vues
Réponses
Nombre de J’aime
Thanks David. That works for GetDate() but what happens if you apply the formula to a field in which the date is only present some of the time? When the date is not present the value output into the field is "00". Is there anyway to overcome this. I have tried various functions, e.g.IsEmptyString(datefield) - with and without ToString(datefield) - Iif(datefield IS NULL, Iif(Length (datefield) = 0 , etc. etc,. and nothing gets parsed.
Vues
Réponses
Nombre de J’aime
Vues
Likes
Réponses
Vues
Likes
Réponses