Author Topic: Date format specifiers  (Read 3951 times)

mwiese

  • Guest
Date format specifiers
« on: February 04, 2016, 05:42:31 PM »
I have a report with dates in the format of Feb 21 2016 and Feb  1 2016.  What date format specifier should I use on the Load Information tab?  I've tried %b %d %Y and %b %e %Y.  I guess I don't understand (and know I can't find the documentation explain) the difference between %3 and %d.  Can anyone enlighten me?  Please?

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2229
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Date format specifiers
« Reply #1 on: February 05, 2016, 04:41:26 AM »
To the best of my knowledge...

%d is a date with leading zeros (ie, "08" "09" "10")

%e is a date without leading zeros ( "8" "9" "10")

It's the same as %m for month with month-with-leading-zero, and %f for month-withOUT-leading-zero.

-JD.
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR

mwiese

  • Guest
Re: Date format specifiers
« Reply #2 on: February 05, 2016, 06:34:11 AM »
Thanks for the info.

%e caused a load failure:

ARS1129E Row 1:  The string "Feb  1 2016" could not be converted to a date from the format of %b %e %Y

%d also failed:
ARS1129E Row 1:  The string "Feb  1 2016" could not be converted to a date from the format of %b %d %Y

I've tried quite a few other combinations which all failed, including removing embedded spaces with %b%e%Y.  I haven't found one that works yet. 

If these are my only options, I'll have to rethink the report design. 

Darrell Bryant

  • Full Member
  • ***
  • Posts: 104
  • Sed fugit interea fugit inreparabile tempus-Virgil
    • View Profile
Re: Date format specifiers
« Reply #3 on: February 23, 2016, 04:15:42 PM »
Based on a quick test, the problem is that you have two spaces between the month and the day in the string 'Feb  1 2016'.  Your date format of %b %e %Y only contains one space.
#IBMi #iSeries #PDF #XML #400 Indexer #ASM

Justin Derrick

  • IBM Content Manager OnDemand Consultant
  • Administrator
  • Hero Member
  • *****
  • Posts: 2229
  • CMOD Guru for hire...
    • View Profile
    • Tenacious Consulting
Re: Date format specifiers
« Reply #4 on: February 24, 2016, 07:59:49 AM »
The second space belongs to the day-of-the-month field.  It appears to be space-padded, not zero-padded.

I'd almost consider this a bug, since I would expect %e to accept a single-digit day-of-the-month with a space prefix as well as a zero prefix.

-JD.
IBM CMOD Professional Services: http://TenaciousConsulting.com
Call:  +1-866-533-7742  or  eMail:  jd@justinderrick.com
IBM CMOD Wiki:  https://CMOD.wiki/
FREE IBM CMOD Education & Webinars:  https://CMOD.Training/

Interests: #AIX #Linux #Multiplatforms #DB2 #TSM #SP #Performance #Security #Audits #Customizing #Availability #HA #DR