Not what you expected huh? The cause is found in the docs: http://lassoguide.com/operations/date-duration.html
The list of ICU Date Formatting Symbols tells that y = year whereas Y = year of “Week of Year”
I honestly have little idea of what “Week of Year” means. But I know the result. Sometimes dates around the end of one year and the beginning of next will be displayed wrong when using YYYY as format.
The correct, and safe, way of formatting an ISO date in Lasso is: `yyyy-MM-dd` Yes, lower case yyyy for full year and dd for day of month. Upper case MM for month.
You can’t go all lower case (too simple) since that will display minute of hour instead of month.
Now, you might think that it would be safer and better to use Lassos old style formatting symbols. Like %Y to display the year. And, yes, that is possible. But it also slows Lasso down. As soon as Lasso discovers old style formatting it will parse the formatting string in a cumbersome way and convert old style to the proper ICU symbols. A small but measurable slowdown.
One last tidbit tip. Notice I use backticks to enclose the formatting symbols? That’s a good habit since it’s the easiest way to also include litteral strings in your date output.
Examples: date -> format(`d MMM yyyy eeee ’W' ww`) date -> format(`yyyyMMdd'T'HHmmss'Z’`)
This message is sent to you because you are subscribed to the mailing list Lasso Lasso@lists.lassosoft.com Official list archives available at http://www.lassotalk.com To unsubscribe, E-mail to: <Lassofirstname.lastname@example.org> Send administrative queries to <Lassoemail@example.com>