Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: ejonesOriginally posted by: johnvvu
That works, thank you.
Also, the fifth line formats the month as a single digit; how could I format May as 05?
You can convert the month to the name of the month by using an array of the month names.
if firstExec then { # if first record in input
# We only need to put a value in this list variable once
monthList = list("ThereIsNoZeroMonth","January"
,"Febuary","March","April"
,"May","June","July","August","September"
,"October","November","December")
}
# then use that list when you want the name corresponding to the number
month = "05" # you started with this
monthNumber = month.int() # you need it to be a number type
monthName = monthList.getItem(monthNumber)
emit monthName as MonthName
Since month names that you would want vary by the location and context, you'll have to create the array with the months spelled the way you want.