line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tivoli::DateTime;
|
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
our(@ISA, @EXPORT, $VERSION, $Fileparse_fstype, $Fileparse_igncase);
|
4
|
|
|
|
|
|
|
require Exporter;
|
5
|
|
|
|
|
|
|
@ISA = qw(Exporter);
|
6
|
|
|
|
|
|
|
@EXPORT = qw(YYYYMMDD YYYYMMDDHHMMSS HHdMMdSS YYYYmMMmDD DDdMMdYYYY DDmMMmYYYY EpocheSS EpocheSS2DdMdYYYY EpocheSS2DdMdYYYYsHdMdS date_split_dot date_split_minus slash_date longDateTime longDate abr_mon abr_day month day month_num day_num year days_left);
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
$VERSION = '0.03';
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);
|
11
|
|
|
|
|
|
|
@nummonths = ("01","02","03","04","05","06","07","08","09","10","11","12");
|
12
|
|
|
|
|
|
|
@months = ("January","February","March","April","May","June","July","August","September","October","November","December");
|
13
|
|
|
|
|
|
|
@abr_months = ("Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec");
|
14
|
|
|
|
|
|
|
@days = ('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
|
15
|
|
|
|
|
|
|
@abr_days = ('Sun','Mon','Tues','Wed','Thurs','Fri','Sat');
|
16
|
|
|
|
|
|
|
$year += 1900;
|
17
|
|
|
|
|
|
|
$mday = "0" . $mday if $mday < 10;
|
18
|
|
|
|
|
|
|
$hour = "0" . $hour if $hour < 10;
|
19
|
|
|
|
|
|
|
$min = "0" . $min if $min < 10;
|
20
|
|
|
|
|
|
|
$sec = "0" . $sec if $sec < 10;
|
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
################################################################################################
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
=pod
|
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
=head1 NAME
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
Tivoli::DateTime - Perl Extension for Tivoli
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
use Tivoli::DateTime;
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
=head1 VERSION
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
v0.03
|
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
=head1 LICENSE
|
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
Copyright (c) 2001 Robert Hase.
|
42
|
|
|
|
|
|
|
All rights reserved.
|
43
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
|
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=over
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
This Package will handle about everything you may need for displaying the date / time.
|
50
|
|
|
|
|
|
|
If anything has been left out, please contact me at
|
51
|
|
|
|
|
|
|
kmeltz@cris.com , tivoli.rhase@muc-net.de
|
52
|
|
|
|
|
|
|
so it can be added.
|
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=back
|
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head2 DETAILS
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
d = dot, s = slash, m = minus
|
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head2 ROUTINES
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Description of Routines
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head3 YYYYMMDD
|
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
=over
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
=item * DESCRIPTION
|
69
|
|
|
|
|
|
|
|
70
|
|
|
|
|
|
|
Returns YYYYMMDD
|
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=item * CALL
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
$Var = &YYYYMMDD;
|
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item * SAMPLE
|
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
$Var = &YYYYMMDD;
|
79
|
|
|
|
|
|
|
$Var = 20010804
|
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=back
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=cut
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
sub YYYYMMDD
|
86
|
|
|
|
|
|
|
{
|
87
|
0
|
|
|
0
|
1
|
|
return($year . @nummonths[$mon] . $mday);
|
88
|
|
|
|
|
|
|
}
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
=pod
|
91
|
|
|
|
|
|
|
|
92
|
|
|
|
|
|
|
=head3 YYYYMMDDHHMMSS
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
=over
|
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=item * DESCRIPTION
|
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
Returns YYYYMMDDHHMMSS
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
=item * CALL
|
101
|
|
|
|
|
|
|
|
102
|
|
|
|
|
|
|
$Var = &YYYYMMDDHHMMSS;
|
103
|
|
|
|
|
|
|
|
104
|
|
|
|
|
|
|
=item * SAMPLE
|
105
|
|
|
|
|
|
|
|
106
|
|
|
|
|
|
|
$Var = &YYYYMMDDHHMMSS;
|
107
|
|
|
|
|
|
|
$Var = 20010804134527
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=back
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=cut
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
sub YYYYMMDDHHMMSS
|
114
|
|
|
|
|
|
|
{
|
115
|
0
|
|
|
0
|
1
|
|
return($year . @nummonths[$mon] . $mday . $hour . $min . $sec);
|
116
|
|
|
|
|
|
|
}
|
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
=pod
|
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
=head3 HHdMMdSS
|
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
=over
|
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=item * DESCRIPTION
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Returns HHdMMdSS
|
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item * CALL
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
$Var = &HHdMMdSS;
|
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=item * SAMPLE
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
$Var = &HHdMMdSS;
|
135
|
|
|
|
|
|
|
$Var = 13.45.27
|
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=back
|
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=cut
|
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
sub HHdMMdSS
|
142
|
|
|
|
|
|
|
{
|
143
|
0
|
|
|
0
|
1
|
|
return("$hour.$min.$sec");
|
144
|
|
|
|
|
|
|
}
|
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
=pod
|
147
|
|
|
|
|
|
|
|
148
|
|
|
|
|
|
|
=head3 YYYYmMMmDD
|
149
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
=over
|
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
=item * DESCRIPTION
|
153
|
|
|
|
|
|
|
|
154
|
|
|
|
|
|
|
Returns YYYYmMMmDD
|
155
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
=item * CALL
|
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
$Var = &YYYYmMMmDD;
|
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
=item * SAMPLE
|
161
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
$Var = &YYYYmMMmDD;
|
163
|
|
|
|
|
|
|
$Var = 2001-08-04
|
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=back
|
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=cut
|
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
sub YYYYmMMmDD
|
170
|
|
|
|
|
|
|
{
|
171
|
0
|
|
|
0
|
1
|
|
return("$year-@nummonths[$mon]-$mday");
|
172
|
|
|
|
|
|
|
}
|
173
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
=pod
|
175
|
|
|
|
|
|
|
|
176
|
|
|
|
|
|
|
=head3 DDdMMdYYYY
|
177
|
|
|
|
|
|
|
|
178
|
|
|
|
|
|
|
=over
|
179
|
|
|
|
|
|
|
|
180
|
|
|
|
|
|
|
=item * DESCRIPTION
|
181
|
|
|
|
|
|
|
|
182
|
|
|
|
|
|
|
Returns DDdMMdYYYY
|
183
|
|
|
|
|
|
|
|
184
|
|
|
|
|
|
|
=item * CALL
|
185
|
|
|
|
|
|
|
|
186
|
|
|
|
|
|
|
$Var = &DDdMMdYYYY;
|
187
|
|
|
|
|
|
|
|
188
|
|
|
|
|
|
|
=item * SAMPLE
|
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
$Var = &DDdMMdYYYY;
|
191
|
|
|
|
|
|
|
$Var = 04.08.2001
|
192
|
|
|
|
|
|
|
|
193
|
|
|
|
|
|
|
=back
|
194
|
|
|
|
|
|
|
|
195
|
|
|
|
|
|
|
=cut
|
196
|
|
|
|
|
|
|
|
197
|
|
|
|
|
|
|
sub DDdMMdYYYY
|
198
|
|
|
|
|
|
|
{
|
199
|
0
|
|
|
0
|
1
|
|
return("$mday.@nummonths[$mon].$year");
|
200
|
|
|
|
|
|
|
}
|
201
|
|
|
|
|
|
|
|
202
|
|
|
|
|
|
|
=pod
|
203
|
|
|
|
|
|
|
|
204
|
|
|
|
|
|
|
=head3 DDmMMmYYYY
|
205
|
|
|
|
|
|
|
|
206
|
|
|
|
|
|
|
=over
|
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
=item * DESCRIPTION
|
209
|
|
|
|
|
|
|
|
210
|
|
|
|
|
|
|
Returns DDmMMmYYYY
|
211
|
|
|
|
|
|
|
|
212
|
|
|
|
|
|
|
=item * CALL
|
213
|
|
|
|
|
|
|
|
214
|
|
|
|
|
|
|
$Var = &DDmMMmYYYY;
|
215
|
|
|
|
|
|
|
|
216
|
|
|
|
|
|
|
=item * SAMPLE
|
217
|
|
|
|
|
|
|
|
218
|
|
|
|
|
|
|
$Var = &DDmMMmYYYY;
|
219
|
|
|
|
|
|
|
$Var = 04-08-2001
|
220
|
|
|
|
|
|
|
|
221
|
|
|
|
|
|
|
=back
|
222
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
=cut
|
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
sub DDmMMmYYYY
|
226
|
|
|
|
|
|
|
{
|
227
|
0
|
|
|
0
|
1
|
|
return("$mday-@nummonths[$mon]-$year");
|
228
|
|
|
|
|
|
|
}
|
229
|
|
|
|
|
|
|
|
230
|
|
|
|
|
|
|
=pod
|
231
|
|
|
|
|
|
|
|
232
|
|
|
|
|
|
|
=head3 EpocheSS
|
233
|
|
|
|
|
|
|
|
234
|
|
|
|
|
|
|
=over
|
235
|
|
|
|
|
|
|
|
236
|
|
|
|
|
|
|
=item * DESCRIPTION
|
237
|
|
|
|
|
|
|
|
238
|
|
|
|
|
|
|
Returns EpocheSS since 1970-01-01 00:00.00
|
239
|
|
|
|
|
|
|
|
240
|
|
|
|
|
|
|
=item * CALL
|
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
$Var = &EpocheSS;
|
243
|
|
|
|
|
|
|
|
244
|
|
|
|
|
|
|
=item * SAMPLE
|
245
|
|
|
|
|
|
|
|
246
|
|
|
|
|
|
|
$Var = &EpocheSS;
|
247
|
|
|
|
|
|
|
$Var = 78762323109843
|
248
|
|
|
|
|
|
|
|
249
|
|
|
|
|
|
|
=back
|
250
|
|
|
|
|
|
|
|
251
|
|
|
|
|
|
|
=cut
|
252
|
|
|
|
|
|
|
|
253
|
|
|
|
|
|
|
sub EpocheSS
|
254
|
|
|
|
|
|
|
{
|
255
|
0
|
|
|
0
|
1
|
|
return(time());
|
256
|
|
|
|
|
|
|
}
|
257
|
|
|
|
|
|
|
|
258
|
|
|
|
|
|
|
=pod
|
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
=head3 EpocheSS2DdMdYYYY
|
261
|
|
|
|
|
|
|
|
262
|
|
|
|
|
|
|
=over
|
263
|
|
|
|
|
|
|
|
264
|
|
|
|
|
|
|
=item * DESCRIPTION
|
265
|
|
|
|
|
|
|
|
266
|
|
|
|
|
|
|
Converts the given Epoche-Seconds to DdMdYYYY
|
267
|
|
|
|
|
|
|
|
268
|
|
|
|
|
|
|
=item * CALL
|
269
|
|
|
|
|
|
|
|
270
|
|
|
|
|
|
|
$Var = &EpocheSS2DdMdYYYY(78762323109843);
|
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
=item * SAMPLE
|
273
|
|
|
|
|
|
|
|
274
|
|
|
|
|
|
|
$Var = &EpocheSS2DdMdYYYY(78762323109843);
|
275
|
|
|
|
|
|
|
$Var = 04.08.2001
|
276
|
|
|
|
|
|
|
|
277
|
|
|
|
|
|
|
=back
|
278
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
=cut
|
280
|
|
|
|
|
|
|
|
281
|
|
|
|
|
|
|
sub EpocheSS2DdMdYYYY
|
282
|
|
|
|
|
|
|
{
|
283
|
|
|
|
|
|
|
# UNIX-Sek in Datum DMY wandeln
|
284
|
|
|
|
|
|
|
# Syntax: &sek2dat(SECONDS);
|
285
|
0
|
|
|
0
|
1
|
|
$U_SEK = $_[0];
|
286
|
0
|
|
|
|
|
|
($TAG, $MONAT, $JAHR) = (localtime $U_SEK) [3,4,5];
|
287
|
0
|
|
|
|
|
|
$MONAT++;
|
288
|
0
|
|
|
|
|
|
$JAHR += 1900;
|
289
|
0
|
|
|
|
|
|
return("$TAG.$MONAT.$JAHR");
|
290
|
|
|
|
|
|
|
}
|
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
=pod
|
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
=head3 EpocheSS2DdMdYYYYsHdMdS
|
295
|
|
|
|
|
|
|
|
296
|
|
|
|
|
|
|
=over
|
297
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
=item * DESCRIPTION
|
299
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
Converts the given Epoche-Seconds to DdMdYYYYsHdMdS
|
301
|
|
|
|
|
|
|
|
302
|
|
|
|
|
|
|
=item * CALL
|
303
|
|
|
|
|
|
|
|
304
|
|
|
|
|
|
|
$Var = &EpocheSS2DdMdYYYYsHdMdS(78762323109843);
|
305
|
|
|
|
|
|
|
|
306
|
|
|
|
|
|
|
=item * SAMPLE
|
307
|
|
|
|
|
|
|
|
308
|
|
|
|
|
|
|
$Var = &EpocheSS2DdMdYYYYsHdMdS(78762323109843);
|
309
|
|
|
|
|
|
|
$Var = 04.08.2001/13.45.27
|
310
|
|
|
|
|
|
|
|
311
|
|
|
|
|
|
|
=back
|
312
|
|
|
|
|
|
|
|
313
|
|
|
|
|
|
|
=cut
|
314
|
|
|
|
|
|
|
|
315
|
|
|
|
|
|
|
sub EpocheSS2DdMdYYYYsHdMdS
|
316
|
|
|
|
|
|
|
{
|
317
|
|
|
|
|
|
|
# UNIX-Sek in Datum DMYhms wandeln
|
318
|
|
|
|
|
|
|
# Syntax: &sek2dat_time(SECONDS);
|
319
|
0
|
|
|
0
|
1
|
|
$U_SEK = $_[0];
|
320
|
0
|
|
|
|
|
|
($SEK, $MIN, $STD, $TAG, $MONAT, $JAHR, $WOCH_TAG, $JAHR_TAG, $ISDST) = (localtime $U_SEK);
|
321
|
0
|
|
|
|
|
|
$MONAT++;
|
322
|
0
|
|
|
|
|
|
$JAHR += 1900;
|
323
|
0
|
|
|
|
|
|
return("$TAG.$MONAT.$JAHR/$STD.$MIN.$SEK");
|
324
|
|
|
|
|
|
|
}
|
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
=pod
|
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=head3 date_split_dot
|
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
=over
|
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=item * DESCRIPTION
|
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
Splits the given Dot-Date 04.08.2001 to 04 08 2001
|
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
=item * CALL
|
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
$Var = &date_split_dot("04.08.2001");
|
339
|
|
|
|
|
|
|
|
340
|
|
|
|
|
|
|
=item * SAMPLE
|
341
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
@Arr = &date_split_dot("04.08.2001");
|
343
|
|
|
|
|
|
|
@Arr = qw(04 08 2001);
|
344
|
|
|
|
|
|
|
|
345
|
|
|
|
|
|
|
=back
|
346
|
|
|
|
|
|
|
|
347
|
|
|
|
|
|
|
=cut
|
348
|
|
|
|
|
|
|
|
349
|
|
|
|
|
|
|
sub date_split_dot
|
350
|
|
|
|
|
|
|
{
|
351
|
|
|
|
|
|
|
# Datum xx.xx.xxxx splitten
|
352
|
|
|
|
|
|
|
# Syntax: &date_split_punkt(DATUM);
|
353
|
0
|
|
|
0
|
1
|
|
$DAT_SPLIT = $_[0];
|
354
|
0
|
|
|
|
|
|
($Tag, $MONAT, $JAHR) = ($DAT_SPLIT =~ /(\d+)\.(\d+)\.(\d+)/);
|
355
|
0
|
|
|
|
|
|
@DAT_SPLIT = ($TAG, $MONAT, $JAHR);
|
356
|
0
|
|
|
|
|
|
return(@DAT_SPLIT);
|
357
|
|
|
|
|
|
|
}
|
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
=pod
|
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
=head3 date_split_minus
|
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
=over
|
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
=item * DESCRIPTION
|
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
Splits the given Date 04-08-2001 to 04 08 2001
|
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
=item * CALL
|
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
$Var = &date_split_minus("04-08-2001");
|
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
=item * SAMPLE
|
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
@Arr = &date_split_minus("04-08-2001");
|
376
|
|
|
|
|
|
|
@Arr = qw(04 08 2001);
|
377
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
=back
|
379
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
=cut
|
381
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
sub date_split_minus
|
383
|
|
|
|
|
|
|
{
|
384
|
|
|
|
|
|
|
# Datum xx-xx-xxxx splitten
|
385
|
|
|
|
|
|
|
# Syntax: &dat_split_strich(DATUM);
|
386
|
0
|
|
|
0
|
1
|
|
$DAT_SPLIT = $_[0];
|
387
|
0
|
|
|
|
|
|
($Tag, $MONAT, $JAHR) = ($DAT_SPLIT =~ /(\d+)-(\d+)-(\d+)/);
|
388
|
0
|
|
|
|
|
|
@DAT_SPLIT = ($TAG, $MONAT, $JAHR);
|
389
|
0
|
|
|
|
|
|
return(@DAT_SPLIT);
|
390
|
|
|
|
|
|
|
}
|
391
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
=pod
|
393
|
|
|
|
|
|
|
|
394
|
|
|
|
|
|
|
=head3 slash_date
|
395
|
|
|
|
|
|
|
|
396
|
|
|
|
|
|
|
=over
|
397
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
=item * DESCRIPTION
|
399
|
|
|
|
|
|
|
|
400
|
|
|
|
|
|
|
Returns MM/DD/YYYY
|
401
|
|
|
|
|
|
|
|
402
|
|
|
|
|
|
|
=item * CALL
|
403
|
|
|
|
|
|
|
|
404
|
|
|
|
|
|
|
$Var = &slash_date;
|
405
|
|
|
|
|
|
|
|
406
|
|
|
|
|
|
|
=item * SAMPLE
|
407
|
|
|
|
|
|
|
|
408
|
|
|
|
|
|
|
$Var = &slash_date;
|
409
|
|
|
|
|
|
|
$Var = 04/08/2001;
|
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
=back
|
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
=cut
|
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
sub slash_date
|
416
|
|
|
|
|
|
|
{
|
417
|
|
|
|
|
|
|
# returns as mm/dd/yy
|
418
|
0
|
|
|
0
|
1
|
|
($ob = $sdate) =~ s/^\d{2}//g;
|
419
|
0
|
|
|
|
|
|
$sdate = "@nummonths[$mon]/$mday/$year";
|
420
|
0
|
|
|
|
|
|
return($sdate);
|
421
|
|
|
|
|
|
|
}
|
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
=pod
|
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
=head3 longDateTime
|
426
|
|
|
|
|
|
|
|
427
|
|
|
|
|
|
|
=over
|
428
|
|
|
|
|
|
|
|
429
|
|
|
|
|
|
|
=item * DESCRIPTION
|
430
|
|
|
|
|
|
|
|
431
|
|
|
|
|
|
|
Returns long DateTime
|
432
|
|
|
|
|
|
|
|
433
|
|
|
|
|
|
|
=item * CALL
|
434
|
|
|
|
|
|
|
|
435
|
|
|
|
|
|
|
$Var = &longDateTime;
|
436
|
|
|
|
|
|
|
|
437
|
|
|
|
|
|
|
=item * SAMPLE
|
438
|
|
|
|
|
|
|
|
439
|
|
|
|
|
|
|
$Var = &longDateTime;
|
440
|
|
|
|
|
|
|
$Var = Saturday, 08 04, 2001 at 13:45:27
|
441
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
=back
|
443
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
=cut
|
445
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
sub longDateTime
|
447
|
|
|
|
|
|
|
{
|
448
|
|
|
|
|
|
|
# Syntax: &date_time;
|
449
|
|
|
|
|
|
|
# Returns as DayName, MonthName MonthDay, Year at hour:minute:second
|
450
|
|
|
|
|
|
|
# if ($hour < 10) { $hour = "0$hour"; }
|
451
|
0
|
0
|
|
0
|
1
|
|
if ($min < 10) { $min = "0$min"; }
|
|
0
|
|
|
|
|
|
|
452
|
0
|
0
|
|
|
|
|
if ($sec < 10) { $sec = "0$sec"; }
|
|
0
|
|
|
|
|
|
|
453
|
0
|
|
|
|
|
|
$date_time = "$days[$wday], $months[$mon] $mday, $year at $hour\:$min\:$sec";
|
454
|
0
|
|
|
|
|
|
return($date_time);
|
455
|
|
|
|
|
|
|
}
|
456
|
|
|
|
|
|
|
|
457
|
|
|
|
|
|
|
=pod
|
458
|
|
|
|
|
|
|
|
459
|
|
|
|
|
|
|
=head3 longDate
|
460
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
=over
|
462
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
=item * DESCRIPTION
|
464
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
Returns long Date
|
466
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
=item * CALL
|
468
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
$Var = &longDate;
|
470
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
=item * SAMPLE
|
472
|
|
|
|
|
|
|
|
473
|
|
|
|
|
|
|
$Var = &longDate;
|
474
|
|
|
|
|
|
|
$Var = Saturday, 08 04, 2001
|
475
|
|
|
|
|
|
|
|
476
|
|
|
|
|
|
|
=back
|
477
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
=cut
|
479
|
|
|
|
|
|
|
|
480
|
|
|
|
|
|
|
sub longDate
|
481
|
|
|
|
|
|
|
{
|
482
|
|
|
|
|
|
|
# Syntax: &long_date;
|
483
|
|
|
|
|
|
|
# Returns as DayName, MonthName MonthDay, Year
|
484
|
0
|
|
|
0
|
1
|
|
$ldate = "$days[$wday], $months[$mon] $mday, $year";
|
485
|
0
|
|
|
|
|
|
return($ldate);
|
486
|
|
|
|
|
|
|
}
|
487
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
=pod
|
489
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
=head3 abr_mon
|
491
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
=over
|
493
|
|
|
|
|
|
|
|
494
|
|
|
|
|
|
|
=item * DESCRIPTION
|
495
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
Returns abbreviation of Month
|
497
|
|
|
|
|
|
|
|
498
|
|
|
|
|
|
|
=item * CALL
|
499
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
$Var = &abr_mon;
|
501
|
|
|
|
|
|
|
|
502
|
|
|
|
|
|
|
=item * SAMPLE
|
503
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
$Var = &abr_mon;
|
505
|
|
|
|
|
|
|
$Var = Aug
|
506
|
|
|
|
|
|
|
|
507
|
|
|
|
|
|
|
=back
|
508
|
|
|
|
|
|
|
|
509
|
|
|
|
|
|
|
=cut
|
510
|
|
|
|
|
|
|
|
511
|
|
|
|
|
|
|
sub abr_mon
|
512
|
|
|
|
|
|
|
{
|
513
|
|
|
|
|
|
|
# Syntax: &abr_mon;
|
514
|
|
|
|
|
|
|
# Returns abbreviation of Month
|
515
|
0
|
|
|
0
|
1
|
|
return($abr_months[$mon]);
|
516
|
|
|
|
|
|
|
}
|
517
|
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
=pod
|
519
|
|
|
|
|
|
|
|
520
|
|
|
|
|
|
|
=head3 abr_day
|
521
|
|
|
|
|
|
|
|
522
|
|
|
|
|
|
|
=over
|
523
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
=item * DESCRIPTION
|
525
|
|
|
|
|
|
|
|
526
|
|
|
|
|
|
|
Returns abbreviation of Day
|
527
|
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
=item * CALL
|
529
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
$Var = &abr_day;
|
531
|
|
|
|
|
|
|
|
532
|
|
|
|
|
|
|
=item * SAMPLE
|
533
|
|
|
|
|
|
|
|
534
|
|
|
|
|
|
|
$Var = &abr_day;
|
535
|
|
|
|
|
|
|
$Var = Sat
|
536
|
|
|
|
|
|
|
|
537
|
|
|
|
|
|
|
=back
|
538
|
|
|
|
|
|
|
|
539
|
|
|
|
|
|
|
=cut
|
540
|
|
|
|
|
|
|
|
541
|
|
|
|
|
|
|
sub abr_day
|
542
|
|
|
|
|
|
|
{
|
543
|
|
|
|
|
|
|
# Syntax: &abr_day;
|
544
|
|
|
|
|
|
|
# Returns abbreviation on Day
|
545
|
0
|
|
|
0
|
1
|
|
return($abr_days[$wday]);
|
546
|
|
|
|
|
|
|
}
|
547
|
|
|
|
|
|
|
|
548
|
|
|
|
|
|
|
=pod
|
549
|
|
|
|
|
|
|
|
550
|
|
|
|
|
|
|
=head3 month
|
551
|
|
|
|
|
|
|
|
552
|
|
|
|
|
|
|
=over
|
553
|
|
|
|
|
|
|
|
554
|
|
|
|
|
|
|
=item * DESCRIPTION
|
555
|
|
|
|
|
|
|
|
556
|
|
|
|
|
|
|
Returns Nr of Month
|
557
|
|
|
|
|
|
|
|
558
|
|
|
|
|
|
|
=item * CALL
|
559
|
|
|
|
|
|
|
|
560
|
|
|
|
|
|
|
$Var = &month;
|
561
|
|
|
|
|
|
|
|
562
|
|
|
|
|
|
|
=item * SAMPLE
|
563
|
|
|
|
|
|
|
|
564
|
|
|
|
|
|
|
$Var = &month;
|
565
|
|
|
|
|
|
|
$Var = 08
|
566
|
|
|
|
|
|
|
|
567
|
|
|
|
|
|
|
=back
|
568
|
|
|
|
|
|
|
|
569
|
|
|
|
|
|
|
=cut
|
570
|
|
|
|
|
|
|
|
571
|
|
|
|
|
|
|
sub month
|
572
|
|
|
|
|
|
|
{
|
573
|
|
|
|
|
|
|
# Syntax: &month;
|
574
|
|
|
|
|
|
|
# Returns Month name
|
575
|
0
|
|
|
0
|
1
|
|
return($months[$mon]);
|
576
|
|
|
|
|
|
|
}
|
577
|
|
|
|
|
|
|
|
578
|
|
|
|
|
|
|
=pod
|
579
|
|
|
|
|
|
|
|
580
|
|
|
|
|
|
|
=head3 day
|
581
|
|
|
|
|
|
|
|
582
|
|
|
|
|
|
|
=over
|
583
|
|
|
|
|
|
|
|
584
|
|
|
|
|
|
|
=item * DESCRIPTION
|
585
|
|
|
|
|
|
|
|
586
|
|
|
|
|
|
|
Returns Nr of Day
|
587
|
|
|
|
|
|
|
|
588
|
|
|
|
|
|
|
=item * CALL
|
589
|
|
|
|
|
|
|
|
590
|
|
|
|
|
|
|
$Var = &day;
|
591
|
|
|
|
|
|
|
|
592
|
|
|
|
|
|
|
=item * SAMPLE
|
593
|
|
|
|
|
|
|
|
594
|
|
|
|
|
|
|
$Var = &day;
|
595
|
|
|
|
|
|
|
$Var = 6
|
596
|
|
|
|
|
|
|
|
597
|
|
|
|
|
|
|
=back
|
598
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
=cut
|
600
|
|
|
|
|
|
|
|
601
|
|
|
|
|
|
|
sub day
|
602
|
|
|
|
|
|
|
{
|
603
|
|
|
|
|
|
|
# Syntax: &day;
|
604
|
|
|
|
|
|
|
# Returns day of week
|
605
|
0
|
|
|
0
|
1
|
|
return($days[$wday]);
|
606
|
|
|
|
|
|
|
}
|
607
|
|
|
|
|
|
|
|
608
|
|
|
|
|
|
|
=pod
|
609
|
|
|
|
|
|
|
|
610
|
|
|
|
|
|
|
=head3 month_num
|
611
|
|
|
|
|
|
|
|
612
|
|
|
|
|
|
|
=over
|
613
|
|
|
|
|
|
|
|
614
|
|
|
|
|
|
|
=item * DESCRIPTION
|
615
|
|
|
|
|
|
|
|
616
|
|
|
|
|
|
|
Returns Nr of Month
|
617
|
|
|
|
|
|
|
|
618
|
|
|
|
|
|
|
=item * CALL
|
619
|
|
|
|
|
|
|
|
620
|
|
|
|
|
|
|
$Var = &month_num;
|
621
|
|
|
|
|
|
|
|
622
|
|
|
|
|
|
|
=item * SAMPLE
|
623
|
|
|
|
|
|
|
|
624
|
|
|
|
|
|
|
$Var = &month_num;
|
625
|
|
|
|
|
|
|
$Var = 8
|
626
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
=back
|
628
|
|
|
|
|
|
|
|
629
|
|
|
|
|
|
|
=cut
|
630
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
sub month_num
|
632
|
|
|
|
|
|
|
{
|
633
|
|
|
|
|
|
|
# Syntax: &month_num;
|
634
|
|
|
|
|
|
|
# Returns number of month
|
635
|
0
|
|
|
0
|
1
|
|
return($nummonths[$mon]);
|
636
|
|
|
|
|
|
|
}
|
637
|
|
|
|
|
|
|
|
638
|
|
|
|
|
|
|
=pod
|
639
|
|
|
|
|
|
|
|
640
|
|
|
|
|
|
|
=head3 day_num
|
641
|
|
|
|
|
|
|
|
642
|
|
|
|
|
|
|
=over
|
643
|
|
|
|
|
|
|
|
644
|
|
|
|
|
|
|
=item * DESCRIPTION
|
645
|
|
|
|
|
|
|
|
646
|
|
|
|
|
|
|
Returns Nr of Day
|
647
|
|
|
|
|
|
|
|
648
|
|
|
|
|
|
|
=item * CALL
|
649
|
|
|
|
|
|
|
|
650
|
|
|
|
|
|
|
$Var = &day_num;
|
651
|
|
|
|
|
|
|
|
652
|
|
|
|
|
|
|
=item * SAMPLE
|
653
|
|
|
|
|
|
|
|
654
|
|
|
|
|
|
|
$Var = &day_num;
|
655
|
|
|
|
|
|
|
$Var = 6
|
656
|
|
|
|
|
|
|
|
657
|
|
|
|
|
|
|
=back
|
658
|
|
|
|
|
|
|
|
659
|
|
|
|
|
|
|
=cut
|
660
|
|
|
|
|
|
|
|
661
|
|
|
|
|
|
|
sub day_num
|
662
|
|
|
|
|
|
|
{
|
663
|
|
|
|
|
|
|
# Syntax: &day_num;
|
664
|
|
|
|
|
|
|
# Returns number of the day
|
665
|
0
|
|
|
0
|
1
|
|
return($mday);
|
666
|
|
|
|
|
|
|
}
|
667
|
|
|
|
|
|
|
|
668
|
|
|
|
|
|
|
=pod
|
669
|
|
|
|
|
|
|
|
670
|
|
|
|
|
|
|
=head3 year
|
671
|
|
|
|
|
|
|
|
672
|
|
|
|
|
|
|
=over
|
673
|
|
|
|
|
|
|
|
674
|
|
|
|
|
|
|
=item * DESCRIPTION
|
675
|
|
|
|
|
|
|
|
676
|
|
|
|
|
|
|
Returns Year
|
677
|
|
|
|
|
|
|
|
678
|
|
|
|
|
|
|
=item * CALL
|
679
|
|
|
|
|
|
|
|
680
|
|
|
|
|
|
|
$Var = &year;
|
681
|
|
|
|
|
|
|
|
682
|
|
|
|
|
|
|
=item * SAMPLE
|
683
|
|
|
|
|
|
|
|
684
|
|
|
|
|
|
|
$Var = &year;
|
685
|
|
|
|
|
|
|
$Var = 2001
|
686
|
|
|
|
|
|
|
|
687
|
|
|
|
|
|
|
=back
|
688
|
|
|
|
|
|
|
|
689
|
|
|
|
|
|
|
=cut
|
690
|
|
|
|
|
|
|
|
691
|
|
|
|
|
|
|
sub year
|
692
|
|
|
|
|
|
|
{
|
693
|
0
|
|
|
0
|
1
|
|
$year = "$year";
|
694
|
0
|
|
|
|
|
|
return($year);
|
695
|
|
|
|
|
|
|
}
|
696
|
|
|
|
|
|
|
|
697
|
|
|
|
|
|
|
=pod
|
698
|
|
|
|
|
|
|
|
699
|
|
|
|
|
|
|
=head3 days_left
|
700
|
|
|
|
|
|
|
|
701
|
|
|
|
|
|
|
=over
|
702
|
|
|
|
|
|
|
|
703
|
|
|
|
|
|
|
=item * DESCRIPTION
|
704
|
|
|
|
|
|
|
|
705
|
|
|
|
|
|
|
Returns days left in year
|
706
|
|
|
|
|
|
|
|
707
|
|
|
|
|
|
|
=item * CALL
|
708
|
|
|
|
|
|
|
|
709
|
|
|
|
|
|
|
$Var = &days_left;
|
710
|
|
|
|
|
|
|
|
711
|
|
|
|
|
|
|
=item * SAMPLE
|
712
|
|
|
|
|
|
|
|
713
|
|
|
|
|
|
|
$Var = &days_left;
|
714
|
|
|
|
|
|
|
$Var = 236
|
715
|
|
|
|
|
|
|
|
716
|
|
|
|
|
|
|
=back
|
717
|
|
|
|
|
|
|
|
718
|
|
|
|
|
|
|
=cut
|
719
|
|
|
|
|
|
|
|
720
|
|
|
|
|
|
|
sub days_left
|
721
|
|
|
|
|
|
|
{
|
722
|
0
|
|
|
0
|
1
|
|
return(365 - $yday);
|
723
|
|
|
|
|
|
|
}
|
724
|
|
|
|
|
|
|
|
725
|
|
|
|
|
|
|
=pod
|
726
|
|
|
|
|
|
|
|
727
|
|
|
|
|
|
|
=head2 Plattforms and Requirements
|
728
|
|
|
|
|
|
|
|
729
|
|
|
|
|
|
|
=over
|
730
|
|
|
|
|
|
|
|
731
|
|
|
|
|
|
|
Supported Plattforms and Requirements
|
732
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
=item * Plattforms
|
734
|
|
|
|
|
|
|
|
735
|
|
|
|
|
|
|
tested on:
|
736
|
|
|
|
|
|
|
|
737
|
|
|
|
|
|
|
- w32-ix86 (Win9x, NT4, Windows 2000)
|
738
|
|
|
|
|
|
|
- aix4-r1 (AIX 4.3)
|
739
|
|
|
|
|
|
|
- Linux (Kernel 2.2.x)
|
740
|
|
|
|
|
|
|
|
741
|
|
|
|
|
|
|
=back
|
742
|
|
|
|
|
|
|
|
743
|
|
|
|
|
|
|
=item * Requirements
|
744
|
|
|
|
|
|
|
|
745
|
|
|
|
|
|
|
requires Perl v5 or higher
|
746
|
|
|
|
|
|
|
|
747
|
|
|
|
|
|
|
=back
|
748
|
|
|
|
|
|
|
|
749
|
|
|
|
|
|
|
=head2 HISTORY
|
750
|
|
|
|
|
|
|
|
751
|
|
|
|
|
|
|
VERSION DATE AUTHOR WORK
|
752
|
|
|
|
|
|
|
----------------------------------------------------
|
753
|
|
|
|
|
|
|
0.01 1999 kmeltz created
|
754
|
|
|
|
|
|
|
0.02 2000-08 RHase several Date / Time Formats
|
755
|
|
|
|
|
|
|
0.03 2001-08-04 RHase POD-Doku added
|
756
|
|
|
|
|
|
|
|
757
|
|
|
|
|
|
|
=head1 AUTHOR
|
758
|
|
|
|
|
|
|
|
759
|
|
|
|
|
|
|
kmeltz, Robert Hase
|
760
|
|
|
|
|
|
|
ID : KMELTZ, RHASE
|
761
|
|
|
|
|
|
|
eMail : kmeltz@cris.com, Tivoli.RHase@Muc-Net.de
|
762
|
|
|
|
|
|
|
Web : http://www.Muc-Net.de
|
763
|
|
|
|
|
|
|
|
764
|
|
|
|
|
|
|
=head1 SEE ALSO
|
765
|
|
|
|
|
|
|
|
766
|
|
|
|
|
|
|
CPAN
|
767
|
|
|
|
|
|
|
http://www.perl.com
|
768
|
|
|
|
|
|
|
|
769
|
|
|
|
|
|
|
=cut
|
770
|
|
|
|
|
|
|
|
771
|
|
|
|
|
|
|
|
772
|
|
|
|
|
|
|
###############################################################################################
|
773
|
|
|
|
|
|
|
|
774
|
|
|
|
|
|
|
1; # return true
|