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');
15 sub to_kivitendo_time {
16 my ($self, %params) = _hashify(1, @_);
17 return $::locale->format_date_object_to_time($self, %params);
21 my ($self, %params) = _hashify(1, @_);
22 return $::locale->format_date_object($self, %params);
31 return $::locale->parse_date_to_object(\%::myconfig, $_[1]);
47 SL::Helpers::DateTime - helper functions for L<DateTime>
55 Returns the current time with the time zone set to the local time zone.
59 Returns the current date with the time zone set to the local time zone.
61 =item C<to_kivitendo %param>
63 Formats the date and time according to the current kivitendo user's
64 date format with L<Locale::format_datetime_object>.
66 The legacy name C<to_lxoffice> is still supported.
68 =item C<from_kivitendo $string>
70 Parses a date string formatted in the current kivitendo user's date
71 format and returns an instance of L<DateTime>.
73 Note that only dates can be parsed at the moment, not the time
74 component (as opposed to L<to_kivitendo>).
76 The legacy name C<from_lxoffice> is still supported.
82 Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>