Revision 38e08b2f
Von Moritz Bunkus vor etwa 12 Jahren hinzugefügt
SL/Helper/DateTime.pm | ||
---|---|---|
11 | 11 |
} |
12 | 12 |
|
13 | 13 |
sub to_lxoffice { |
14 |
return $::locale->format_date(\%::myconfig, $_[0]); |
|
14 |
my $self = shift; |
|
15 |
my %params = (scalar(@_) == 1) && (ref($_[0]) eq 'HASH') ? %{ $_[0] } : @_; |
|
16 |
return $::locale->format_date_object($self, %params); |
|
15 | 17 |
} |
16 | 18 |
|
17 | 19 |
sub from_lxoffice { |
... | ... | |
40 | 42 |
|
41 | 43 |
Returns the current date with the time zone set to the local time zone. |
42 | 44 |
|
43 |
=item C<to_lxoffice> |
|
45 |
=item C<to_lxoffice %param>
|
|
44 | 46 |
|
45 |
Formats the date according to the current Lx-Office user's date
|
|
46 |
format.
|
|
47 |
Formats the date and time according to the current Lx-Office user's
|
|
48 |
date format with L<Locale::format_datetime_object>.
|
|
47 | 49 |
|
48 |
=item C<from_lxoffice> |
|
50 |
=item C<from_lxoffice $string>
|
|
49 | 51 |
|
50 | 52 |
Parses a date string formatted in the current Lx-Office user's date |
51 | 53 |
format and returns an instance of L<DateTime>. |
52 | 54 |
|
55 |
Note that only dates can be parsed at the moment, not the time |
|
56 |
component (as opposed to L<to_lxoffice>). |
|
57 |
|
|
53 | 58 |
=back |
54 | 59 |
|
55 | 60 |
=head1 AUTHOR |
Auch abrufbar als: Unified diff
Locale: Methode format_date_object zum Formatieren von DateTime-Instanzen; Doku
Unterstützt auch Ausgabe von Stunden, Minuten, Sekunden mittels eines
Parameters 'precision'.