From ed5640d8b587fbcfed7dd7967f3de04b37a76f26 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:06:44 +0200 Subject: Adding upstream version 4:7.4.7. Signed-off-by: Daniel Baumann --- .../source/text/sbasic/shared/03150000.xhp | 142 +++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 helpcontent2/source/text/sbasic/shared/03150000.xhp (limited to 'helpcontent2/source/text/sbasic/shared/03150000.xhp') diff --git a/helpcontent2/source/text/sbasic/shared/03150000.xhp b/helpcontent2/source/text/sbasic/shared/03150000.xhp new file mode 100644 index 000000000..01ed09073 --- /dev/null +++ b/helpcontent2/source/text/sbasic/shared/03150000.xhp @@ -0,0 +1,142 @@ + + + + + + + FormatDateTime Function [VBA] + /text/sbasic/shared/03150000.xhp + + + + + +
+ + FormatDateTime function + + + FormatDateTime Function [VBA] + Applies a date and/or time format to a date expression and returns the result as a string. +
+ + + + FormatDateTime (DateExpression as Date [, NamedFormat as Integer]) + + + String + + DateExpression: The date expression to be formatted. + NamedFormat: An optional vbDateTimeFormat enumeration specifying the format that is to be applied to the date and time expression. If omitted, the value vbGeneralDate is used. + Date and Time formats (vbDateTimeFormat enumeration) +
+ + + + Named Constant + + + Value + + + Description + + + + + vbGeneralDate + + + 0 + + + Displays a date and/or time as defined in your system's General Date setting. If a date only, no time is displayed; If a time only, no date is displayed. + + + + + vbLongDate + + + 1 + + + Display a date using the long date format specified in your computer's regional settings. + + + + + vbShortDate + + + 2 + + + Display a date using the short date format specified in your computer's regional settings. + + + + + vbLongTime + + + 3 + + + Displays a time as defined in your system's Long Time settings. + + + + + vbShortTime + + + 4 + + + Display a time using the 24-hour format (hh:mm). + + +
+
+ + + + + + REM ***** BASIC ***** + Option VBASupport 1 + Sub DateFormat + Dim d as Date + d = ("1958-01-29 00:25") + msgbox("General date format : " & FormatDateTime(d)) + msgbox("Long date format : " & FormatDateTime(d,vbLongDate)) + msgbox("Short date format : " & FormatDateTime(d,vbShortDate)) + msgbox("Long time format : " & FormatDateTime(d,3)) + msgbox("Short time format : " & FormatDateTime(d,vbShortTime)) + End Sub + + +
+ +
+ + +
-- cgit v1.2.3