No you can't, unless you write your own version of the module (edit: which I think is a bad idea BTW). DateTime sets default values in two different places. First in new, a validator is used, with the entries:
Then new calls _new, which setshour => { type => t('Hour'), default => 0, }, minute => { type => t('Minute'), default => 0, }, second => { type => t('Second'), default => 0, },
After that there's no difference between defining those values to 0, or not defining them from the caller.# If this method is called from somewhere other than new(), then s +ome of # these defaults may not get applied. ... $p{hour} = 0 unless exists $p{hour} +; $p{minute} = 0 unless exists $p{minut +e}; $p{second} = 0 unless exists $p{secon +d};
In reply to Re: Detecting whether DateTime object has a time component or not?
by Eily
in thread Detecting whether DateTime object has a time component or not?
by perlancar
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |