From 940b4d1848e8c70ab7642901a68594e8016caffc Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 18:51:28 +0200 Subject: Adding upstream version 1:7.0.4. Signed-off-by: Daniel Baumann --- .../source/text/sbasic/shared/03030101.xhp | 70 ++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/03030101.xhp (limited to 'helpcontent2/source/text/sbasic/shared/03030101.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/03030101.xhp b/helpcontent2/source/text/sbasic/shared/03030101.xhp new file mode 100644 index 000000000..a313f6731 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03030101.xhp @@ -0,0 +1,70 @@ + + + + + + + +DateSerial Function +/text/sbasic/shared/03030101.xhp + + +Sun Microsystems, Inc. + + + +
+DateSerial function + +DateSerial Function +Returns a Date value for a specified year, month, or day. +
+Syntax: + +DateSerial (year, month, day) + +Return value: +Date +Parameters: + +Year: Integer expression that indicates a year. All values between 0 and 99 are interpreted as the years 1900-1999. For years that fall outside this range, you must enter all four digits. + +Month: Integer expression that indicates the month of the specified year. The accepted range is from 1-12. + +Day: Integer expression that indicates the day of the specified month. The accepted range is from 1-31. No error is returned when you enter a non-existing day for a month shorter than 31 days.see i69463 +The DateSerial function returns the number of days between December 30,1899 and the given date. You can use this function to calculate the difference between two dates. +The DateSerial function returns the data type Variant with VarType 7 (Date). Internally, this value is stored as a Double value, so that when the given date is 1.1.1900, the returned value is 2. Negative values correspond to dates before December 30, 1899 (not inclusive). +If a date is defined that lies outside of the accepted range, $[officename] Basic returns an error message. +Whereas you define the DateValue function as a string that contains the date, the DateSerial function evaluates each of the parameters (year, month, day) as separate numeric expressions. + + +Example: + +Sub ExampleDateSerial +Dim lDate As Long +Dim sDate As String + lDate = DateSerial(1964, 4, 9) + sDate = DateSerial(1964, 4, 9) + MsgBox lDate ' returns 23476 + MsgBox sDate ' returns 04/09/1964 +End Sub + + +
+ -- cgit v1.2.3