Hi, I'm trying to work with %_date% in Export, converting it to YYYY-MM-DD
%_date% generates this format: 19. 1. 2025
Basically I could use $regexp($regexp(%_date%,(\d+)\.\s(\d+)\.\s(\d\d\d\d),$3-$2-$1),(\d\d\d\d)-(\d+)-(\d+),$1-$2-$3)
but I don't know how to add leading zeros only for a single digit month or day?
It you don’t want to (or cannot) fix leading zeros system-wide, you can always run multiple steps to fix days and months separately with regular expressions.
Try a format string like: $regexp(%_date%,(\d+)\.\s*(\d+)\.\s*(\d+),$3)-$num($regexp(%_date%,(\d+)\.\s*(\d+)\.\s*(\d+),$2),2)-$num($regexp(%_date%,(\d+)\.\s*(\d+)\.\s*(\d+),$1),2)