Description: Time and Time$ both return a String, while the former should return a Variant (Date) which would be consistent with VBA. Time should be documented as a function - not as a statement - as changing time on Unix platforms requires admin privilege. Time statement does not function under Windows and should therefore be marked as unsupported. Steps to Reproduce: 1. Example Basic code: Private Sub _Time_ CompatibilityMode(True) Print TypeName(Time()), VarType(Time), TypeName(Time$), VarType(Time$()) Time = "18:20:15" ' does nothing CompatibilityMode(False) End Sub 2. Run and observe the routine results Actual Results: Time$ returns a locale-dependant String output Time returns a locale-dependant String output Expected Results: Time$ to return a locale-dependant String output Time to return a Variant of Type 7 (Date/Time) Reproducible: Always User Profile Reset: No Additional Info: Version: 6.4.4.2 (x64) Build ID: 3d775be2011f3886db32dfd395a6a6d1ca2630ff CPU threads: 12; OS: Windows 10.0 Build 17134; UI render: default; VCL: win; Locale: en-GB (en_IE); UI-Language: en-GB Calc: threaded
Confirmed in: Version: 6.3.0.0.beta1 (x64) Build-ID: a187af327633f5f00363be5131bd21a13e0f1a7b CPU-Threads: 4; BS: Windows 10.0; UI-Render: GL; VCL: win; Gebietsschema: de-DE (de_DE); UI-Sprache: de-DE Calc: CL However, Time$ does not return a locale-dependent String: https://opengrok.libreoffice.org/xref/core/basic/source/runtime/methods.cxx?r=40031dd4#2239
examples for Time/Time$ as a function - Time[$] LotusScript Basic-like help https://help.hcltechsw.com/dom_designer/10.0.1/basic/LSAZ_TIME_FUNCTION.html?hl=time%2Cfunction - Time[$] Basic CGS help https://www.ge.com/digital/documentation/cimplicity/version11/oxy_ex-2/basic_control_engine_and_scripting/topics/r_cimplicity_basic_control_engine_and_scripting_reference_time_time__functions_.html
As opposed to Time function, Date[$] function behaves consistently: - Date returns a Variant - Date$ returns a String Similarly to Time function, Date should be documented as function instead of a statement. As platform date updates are restricted to worksattion admins.
REM *** DATE FUNCTION EXAMPLE *** Sub _Date_ Print Date, TypeName(Date()), VarType(Date), Date$, TypeName(Date$), VarType(Date$()) Date = "February 12, 1985" ' does nothing End Sub - VBA Date function https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/date-function - VBA Date statement https://docs.microsoft.com/en-us/office/vba/language/reference/user-interface-help/date-statement
Alain Romedenne committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/help/commit/5b2fdb324ae69febd7af11b10ce6882d98894ebd tdf#136112 Date/Time are LibO Basic functions not statements
Alain Romedenne committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/c3c8d2d67174beddb27fc94b10aebed259500133 tdf#136112 Unit test for Date() Basic function It will be available in 7.1.0. The patch should be included in the daily builds available at https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More information about daily builds can be found at: https://wiki.documentfoundation.org/Testing_Daily_Builds Affected users are encouraged to test the fix and report feedback.
Suggestion for a QA unit test routine: Function doUnitTest as Integer ''' Return 'text' OR 'date' variable ''' If ( TypeName(Time$)<>"String" Or Vartype(Time())<>V_DATE ) Then doUnitTest = 0 ' not successful Else doUnitTest = 1 ' Ok End If End Function Sub DEV_TST : MsgBox doUnitTesT : End Sub
Dear Alain Romedenne, To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year. There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present. If you have time, please do the following: Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/ If the bug is present, please leave a comment that includes the information from Help - About LibreOffice. If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice. Please DO NOT Update the version field Reply via email (please reply directly on the bug tracker) Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not appropriate in this case) If you want to do more to help you can test to see if your issue is a REGRESSION. To do so: 1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/ 2. Test your bug 3. Leave a comment with your results. 4a. If the bug was present with 3.3 - set version to 'inherited from OOo'; 4b. If the bug was not present in 3.3 - add 'regression' to keyword Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa Thank you for helping us make LibreOffice even better for everyone! Warm Regards, QA Team MassPing-UntouchedBug
- Documentation has been modified for correctness - Date function QA test case added Time function QA test case remains to be implemented once code is fixed.