You were very close to an answer. You just needed to capture the time part in fourth set of parenthesis and then toss it by not referring to it.
Assuming that there's always just one space between the date and the time:
$date =~ s/(\d{4})\-(\d{2})\-(\d{2})(\s.+)/$3\.$2\.$1/;
non-Perl: Andy Ford
In reply to Re: Custom date string formatting
by andyford
in thread Custom date string formatting
by nelio
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |