5 use SL::Util qw(_hashify);
8 return shift->now(time_zone => $::locale->get_local_time_zone);
12 return shift->now(time_zone => $::locale->get_local_time_zone)->truncate(to => 'day');
16 my ($self, %params) = _hashify(1, @_);
17 return $::locale->format_date_object($self, %params);
26 return $::locale->parse_date_to_object(\%::myconfig, $_[1]);
42 SL::Helpers::DateTime - helper functions for L<DateTime>
50 Returns the current time with the time zone set to the local time zone.
54 Returns the current date with the time zone set to the local time zone.
56 =item C<to_kivitendo %param>
58 Formats the date and time according to the current kivitendo user's
59 date format with L<Locale::format_datetime_object>.
61 The legacy name C<to_lxoffice> is still supported.
63 =item C<from_kivitendo $string>
65 Parses a date string formatted in the current kivitendo user's date
66 format and returns an instance of L<DateTime>.
68 Note that only dates can be parsed at the moment, not the time
69 component (as opposed to L<to_kivitendo>).
71 The legacy name C<from_lxoffice> is still supported.
77 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>