Forum Discussion

sedens's avatar
sedens
Contributor
3 years ago

Leading zeros are not dropped when using %#d in aqConvert.DateTimeToFormatStr function

I need to remove leading zeros from the day when using date formats e.g. 7/15/1994 instead of 07/15/1994 however when I use the aqConvert.DateTimeToFormatStr function it does not drop the leading zer...
  • npaisley's avatar
    3 years ago

    Hi sedens!

     

    Pardon any confusion here on my part, but it appears you are looking to drop the zero from the Month in this case? Which means we need to apply the '#' to the Month section as well, instead of just the Day. 

     

    This formatting removes all the zeros from your date in a script I built out;

    aqConvert.DateTimeToFormatStr(myDate, "%#m/%#d/%Y")

     

    I hope this helps!