use strict; use warnings; use URI; use URI::QueryParam; use URI::Escape; my $t1_str = uri_escape('2022-12-18 12:19:57'); print $t1_str; #it what I want space to %20 print "\n"; my $u = URI->new("/api/Data", "http"); $u->query_param(t1 => '2022-12-18 12:19:57'); print $u->as_string; #here space change into +