DateDiff Function in LO Base Basic Macros

DateDiff Function [Runtime] - LibreOffice Help says there is a function although page not updated since 2013. Gives example

Sub example_datediff
    MsgBox DateDiff("d", "1/1/2005", "12/31/2005")
End Sub

Results in Error: Inadmissible value or data type. Data type mismatch.

Would be useful to know how to access this Function; is it in a package or just not available?

Peter

Windows10 LO 6.1.1.2 (x64)

Hello,

On Mint18.3 using LO v6.2.3.2 don’t have any problem. Message Box displays - 364

Seem to recall using this in past versions without problem also.

(I wouldn’t have believed that LibreOffice Basic has a DateDiff function being equivalent to the spreadsheet DATEDIF, but using a different order of the arguments and a different abbreviation. How silly are things alowed to be? Infinitely?)
The OQ’s install of LibO/Basic may refuse to accept the US-specific “mid-endian” date format. At least my “en-UK” version throws the reported error. Down with stubborn formats!

Good points!

Ratslinger,
after various unsuccessful efforts include re-typing the whole thing, it suddenly worked! Why? well of course I typed in a random date, and that was in UK date format! Rather than the example which is US date format.

My settings are
LO Options -Language Settings -Languages -Date Acceptance patterns: D/M/Y;D/M;D-M

Again thanks for reassuring me it ought to work.

Peter
Windows10 LO 6.1.1.2 (x64)