summaryrefslogtreecommitdiffstats
path: root/kspread/extensions/datetime.xml
blob: be64342a46440e64967d7e7c57de03bd510ed171 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
<!DOCTYPE KSpreadFunctions>
<KSpreadFunctions>

  <Group>
    <GroupName>Date &amp; Time</GroupName>

    <Function>
      <Name>WEEKDAY</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Date</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Method (optional)</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The WEEKDAY() function returns the weekday of given date. If the method is 1 (default) WEEKDAY() returns 1 for sunday, 2 for monday,.. If the method is 2, monday is 1, tuesday 2, ... and if the method is 3 WEEKDAY() returns 0 for monday, 1 for tuesday,...</Text>
	<Syntax>WEEKDAY(date; method)</Syntax>
	<Example>WEEKDAY("2002-02-22"; 2) returns 5</Example>
        <Related>DAYNAME</Related>
      </Help>
    </Function>

    <Function>
      <Name>DAYS360</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Date1</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Date2</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Method</Comment>
	<Type>Boolean</Type>
      </Parameter>
      <Help>
	<Text>The DAYS360() function returns the number of days from date1 to date2 using a 360-day calendar in which all months are assumed to have 30 days. If method is false (default) the US method will be used, the European otherwise.</Text>
	<Syntax>DAYS360(date1; date2; method)</Syntax>
	<Example>DAYS360("2/22/2002"; "4/21/2002"; FALSE) returns 59</Example>
        <Related>DAYS</Related>
        <Related>MONTHS</Related>
        <Related>WEEKS</Related>
        <Related>YEARS</Related>
      </Help>
    </Function>

    <Function>
      <Name>TIMEVALUE</Name>
      <Type>Float</Type>
      <Parameter>
	<Comment>Time</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The TIMEVALUE() function returns a number (between 0 and 1) representing the time of day.</Text>
	<Syntax>TIMEVALUE(time)</Syntax>
	<Example>TIMEVALUE("10:05:02") returns 0.42</Example>
        <Related>DATEVALUE</Related>
      </Help>
    </Function>

    <Function>
      <Name>DATEVALUE</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Date</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The DATEVALUE function returns a number representing the day, i.e the number of days elapsed since December 31, 1899.</Text>
	<Syntax>DATEVALUE(date)</Syntax>
	<Example>DATEVALUE("2/22/2002") returns 37309</Example>
        <Related>TIMEVALUE</Related>
      </Help>
    </Function>

    <Function>
      <Name>EDATE</Name>
      <Type>Date</Type>
      <Parameter>
	<Comment>Date</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Months</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The EDATE functions returns the date that is specified by a given date and a number of months before or after that date.</Text>
	<Syntax>EDATE(date; months)</Syntax>
	<Example>EDATE("2/22/2002"; 3) returns "5/22/2002"</Example>
	<Example>EDATE("3/31/2002"; -1) returns "2/28/2002"</Example>
        <Related>DATE</Related>
        <Related>EOMONTH</Related>
      </Help>
    </Function>    

    <Function>
      <Name>EOMONTH</Name>
      <Type>Date</Type>
      <Parameter>
	<Comment>Date</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Months</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The EOMONTH functions returns the last day in the month specified by a date and the number of months from that date.</Text>
	<Syntax>EOMONTH(date; months)</Syntax>
	<Example>EOMONTH("2/22/2002"; 3) returns "5/31/2002"</Example>
	<Example>EOMONTH("3/12/2002"; -1) returns "2/28/2002"</Example>
	<Example>EOMONTH("3/12/2002"; 0) returns "3/31/2002"</Example>
        <Related>EDATE</Related>
        <Related>MONTH</Related>
      </Help>
    </Function>    

    <Function>
      <Name>YEAR</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Date</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The YEAR functions returns the year of a date. If no parameter is specified the current year gets returned.</Text>
	<Syntax>YEAR(date)</Syntax>
	<Example>YEAR("2/22/2002") returns 2002</Example>
	<Example>YEAR(2323.1285) returns 1906</Example>
        <Related>DAY</Related>
        <Related>MONTH</Related>
      </Help>
    </Function>    

    <Function>
      <Name>MONTH</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Date</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The MONTH functions returns the month of a date. If no parameter is specified the current month gets returned.</Text>
	<Syntax>MONTH(date)</Syntax>
	<Example>MONTH("2/22/2002") returns 2</Example>
	<Example>MONTH(2323.1285) returns 5</Example>
        <Related>DAY</Related>
        <Related>YEAR</Related>
      </Help>
    </Function>    

    <Function>
      <Name>DAY</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Date</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The DAY functions returns the day of a date. If no parameter is specified the current day gets returned.</Text>
	<Syntax>DAY(date)</Syntax>
	<Example>DAY("2/22/2002") returns 22</Example>
	<Example>DAY(2323.1285) returns 11</Example>
        <Related>MONTH</Related>
        <Related>YEAR</Related>
      </Help>
    </Function>    

    <Function>
      <Name>HOUR</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Time</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The HOUR functions returns the hour of a time. If no parameter is specified the current hour gets returned.</Text>
	<Syntax>HOUR(time)</Syntax>
	<Example>HOUR("22:10:12") returns 22</Example>
	<Example>HOUR(0.1285) returns 3</Example>
        <Related>MINUTE</Related>
        <Related>SECOND</Related>
      </Help>
    </Function>    

    <Function>
      <Name>MINUTE</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Time</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The MINUTE functions returns the minutes of a time. If no parameter is specified the current minute is returned.</Text>
	<Syntax>MINUTE(time)</Syntax>
	<Example>MINUTE("22:10:12") returns 10</Example>
	<Example>MINUTE(0.1234) returns 57</Example>
        <Related>HOUR</Related>
        <Related>SECOND</Related>
      </Help>
    </Function>    

    <Function>
      <Name>SECOND</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Time</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The SECOND functions returns the seconds of a time. If no parameter is specified the current second is returned.</Text>
	<Syntax>SECOND(time)</Syntax>
	<Example>SECOND("22:10:12") returns 12</Example>
	<Example>SECOND(0.1234) returns 42</Example>
        <Related>HOUR</Related>
        <Related>MINUTE</Related>
      </Help>
    </Function>    

    <Function>
      <Name>WEEKS</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>First (earlier) date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Second date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Calculation mode</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The WEEKS() function returns the difference between two dates in weeks.The third parameter indicates the calculation mode: if the mode is 0, WEEKS() returns the maximal possible number of weeks between those days. If the mode is 1, it only returns the number of whole weeks in between.</Text>
	<Syntax>WEEKS(date2; date1; mode)</Syntax>
	<Example>WEEKS("2002-02-18"; "2002-02-26"; 0) returns 1, because there is one week and 1 day in between</Example>
	<Example>WEEKS("2002-19-02"; "2002-19-02"; 1) returns 0, because there is not a whole week in between, starting at the first day of the week (monday or sunday, depending on your local settings)</Example>
      </Help>
    </Function>

    <Function>
      <Name>MONTHS</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>First (earlier) date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Second date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Calculation mode</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The MONTHS() function returns the difference between two dates in months.The third parameter indicates the calculation mode: if the mode is 0, MONTHS() returns the maximal possible number of months between those days. If the mode is 1, it only returns the number of complete months in between.</Text>
	<Syntax>MONTHS(date2; date1; mode)</Syntax>
	<Example>MONTHS("2002-01-18"; "2002-02-26"; 0) returns 1, because there is 1 month and 8 days in between</Example>
	<Example>MONTHS("2002-01-19"; "2002-02-26"; 1) returns 0, because there is not a whole month in between, starting at the first day of the month</Example>
      </Help>
    </Function>

    <Function>
      <Name>YEARS</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>First (earlier) date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Second date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Calculation mode</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The YEARS() function returns the difference between two dates in years. The third parameter indicates the calculation mode: if the mode is 0, YEARS() returns the maximal possible number of years between those days. If the mode is 1, it only returns whole years, starting at the 1st Jan and ending on the 31st Dec.</Text>
	<Syntax>YEARS(date2; date1; mode)</Syntax>
	<Example>YEARS("2001-02-19"; "2002-02-26"; 0) returns 1, because there is one year and 7 days in between</Example>
	<Example>YEARS("2002-02-19"; "2002-02-26"; 1) returns 0, because there is not a whole year in between, starting at the first day of the year</Example>
      </Help>
    </Function>

    <Function>
      <Name>DAYS</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>First (earlier) date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Parameter>
	<Comment>Second date value</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The DAYS() function returns the difference between two dates in days.</Text>
	<Syntax>DAYS(date2; date1)</Syntax>
	<Example>DAYS("2002-02-22"; "2002-02-26") returns 4</Example>
      </Help>
    </Function>

    <Function>
      <Name>DAYOFYEAR</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Year</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Month</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Day</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The DAYOFYEAR() function returns the number of the day in the year (1...365).</Text>
	<Syntax>DAYOFYEAR(year;month;date)</Syntax>
	<Example>DAYOFYEAR(2000;12;1) returns 336</Example>
	<Example>DAYOFYEAR(2000;2;29) returns 60</Example>
      </Help>
    </Function>

    <Function>
      <Name>DATE</Name>
      <Type>String</Type>
      <Parameter>
	<Comment>Year</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Month</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Day</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The DATE() function returns the date formatted with local parameters.</Text>
	<Syntax>DATE(year;month;date)</Syntax>
	<Example>DATE(2000;5;5) returns Friday 05 May 2000</Example>
      </Help>
    </Function>

    <Function>
      <Name>TIME</Name>
      <Type>String</Type>
      <Parameter>
	<Comment>Hours</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Minutes</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Seconds</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The TIME() function returns the time formatted with local parameters.</Text>
	<Syntax>TIME(hours;minutes;seconds)</Syntax>
	<Example>TIME(10;2;2) returns 10:02:02</Example>
        <Example>TIME(10;70;0) returns 11:10:0</Example>
        <Example>TIME(10;-40;0) returns 9:20:0</Example>
      </Help>
    </Function>
    
    <Function>
     <Name>HOURS</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Time</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The HOURS() function returns the value of the hours in a time expression.</Text>
	<Syntax>HOURS(time)</Syntax>
	<Example>HOURS("10:5:2") returns 10</Example>
      </Help>
    </Function>

    <Function>
     <Name>ISLEAPYEAR</Name>
      <Type>Boolean</Type>
      <Parameter>
	<Comment>Year</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The function ISLEAPYEAR() returns True if the given year is leap.</Text>
	<Syntax>ISLEAPYEAR(year)</Syntax>
	<Example>ISLEAPYEAR(2000) returns True</Example>
      </Help>
    </Function>

    <Function>
     <Name>DAYSINMONTH</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Year</Comment>
	<Type>Int</Type>
      </Parameter>
      <Parameter>
	<Comment>Month</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The function DAYSINMONTH() returns number of days in the given year and month.</Text>
	<Syntax>DAYSINMONTH(year;month)</Syntax>
	<Example>DAYSINMONTH(2000;2) returns 29</Example>
      </Help>
    </Function>

    <Function>
     <Name>DAYSINYEAR</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Year</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The function DAYSINYEAR() returns the number of days in the given year.</Text>
	<Syntax>DAYSINYEAR(year)</Syntax>
	<Example>DAYSINYEAR(2000) returns 366</Example>
      </Help>
    </Function>

    <Function>
     <Name>WEEKSINYEAR</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Year</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The function WEEKSINYEAR() returns the number of weeks in the given year.</Text>
	<Syntax>WEEKSINYEAR(year)</Syntax>
	<Example>WEEKSINYEAR(2000) returns 52</Example>
      </Help>
    </Function>

    <Function>	  
     <Name>MINUTES</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Time</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The MINUTES() function returns the value of the minutes in a time expression.</Text>
	<Syntax>MINUTES(time)</Syntax>
	<Example>MINUTES("10:5:2") returns 5</Example>
      </Help>
    </Function>

    <Function>
     <Name>SECONDS</Name>
      <Type>Int</Type>
      <Parameter>
	<Comment>Time</Comment>
	<Type>String</Type>
      </Parameter>
      <Help>
	<Text>The SECONDS() function returns the value of the seconds in a time expression.</Text>
	<Syntax>SECONDS(time)</Syntax>
	<Example>SECONDS("10:5:2") returns 2</Example>
      </Help>
    </Function>

    <Function>
      <Name>DAYNAME</Name>
      <Type>String</Type>
      <Parameter>
	<Comment>Number of day in week (1..7)</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The DAYNAME() function returns the name of the day of the week (1..7). In some countries the first day of the week is Monday, while in others the first day of the week is Sunday.</Text>
	<Syntax>DAYNAME(weekday)</Syntax>
	<Example>DAYNAME(1) returns Monday (if the week starts on Monday)</Example>
        <Related>WEEKDAY</Related>
      </Help>
    </Function>

    <Function>
      <Name>MONTHNAME</Name>
      <Type>String</Type>
      <Parameter>
	<Comment>Number of month (1..12)</Comment>
	<Type>Int</Type>
      </Parameter>
      <Help>
	<Text>The MONTHNAME() function returns the name of the month (1...12).</Text>
	<Syntax>MONTHNAME(number)</Syntax>
	<Example>MONTHNAME(5) returns May</Example>
      </Help>
    </Function>

    <Function>
      <Name>CURRENTDATE</Name>
      <Type>Date</Type>
      <Help>
	<Text>The CURRENTDATE() function returns the current date. It is equivalent to the TODAY function.</Text>
	<Syntax>CURRENTDATE()</Syntax>
	<Example>CURRENTDATE() returns "Saturday 13 April 2002"</Example>
        <Related>CURRENTTIME</Related>
        <Related>TODAY</Related>
      </Help>
    </Function>

    <Function>
      <Name>TODAY</Name>
      <Type>Date</Type>
      <Help>
	<Text>The TODAY() function returns the current date.</Text>
	<Syntax>TODAY()</Syntax>
	<Example>TODAY() returns "Saturday 13 April 2002"</Example>
        <Related>CURRENTTIME</Related>
        <Related>NOW</Related>
      </Help>
    </Function>

    <Function>
      <Name>NOW</Name>
      <Type>Date</Type>
      <Help>
	<Text>The NOW() function returns the current date and time. It is identical with CURRENTDATETIME and provided for compatibility with other applications.</Text>
	<Syntax>NOW()</Syntax>
	<Example>NOW() returns "Saturday 13 April 2002 19:12:01"</Example>
        <Related>CURRENTTIME</Related>
        <Related>TODAY</Related>
      </Help>
    </Function>

    <Function>
      <Name>CURRENTDATETIME</Name>
      <Type>Date</Type>
      <Help>
	<Text>The CURRENTDATETIME() function returns the current date and time.</Text>
	<Syntax>CURRENTDATETIME()</Syntax>
	<Example>CURRENTDATETIME() returns "Saturday 13 April 2002 19:12:01"</Example>
      </Help>
    </Function>

    <Function>
      <Name>CURRENTTIME</Name>
      <Type>Date</Type>
      <Help>
	<Text>The CURRENTTIME() function returns the current time formatted with local parameters.</Text>
	<Syntax>CURRENTTIME()</Syntax>
	<Example>CURRENTTIME() returns "19:12:01"</Example>
      </Help>
    </Function>

	<Function>
      <Name>EASTERSUNDAY</Name>
      <Type>Date</Type>
	  <Parameter>
		<Comment>Year</Comment>
		<Type>Int</Type>
      </Parameter>
      <Help>
		<Text>The EASTERSUNDAY() function returns the date which corresponds to Easter Sunday in the year given as the parameter.</Text>
		<Syntax>EASTERSUNDAY(year)</Syntax>
		<Example>EASTERSUNDAY(2003) returns "20th April 2003"</Example>
      </Help>
    </Function>

	<Function>
      <Name>ISOWEEKNUM</Name>
      <Type>Int</Type>
	  <Parameter>
		<Comment>Date</Comment>
		<Type>String</Type>
      </Parameter>
      <Help>
		<Text>The ISOWEEKNUM() function returns number of the week which the date falls into. Note that this function is compliant with the ISO8601 standard: a week always begins on a Monday, and ends on a Sunday. The first week of a year is that week which contains the first Thursday of the year.</Text>
		<Syntax>ISOWEEKNUM(date)</Syntax>
		<Example>ISOWEEKNUM(A1) returns 51 when A1 is "21st of Dec".</Example>
      </Help>
    </Function>

  </Group>

</KSpreadFunctions>