Hallo Axel,
ich habe eben mal einen Uralt-Code (1997) herausgesucht:
| Set itemCutOffDate = docSetup.GetFirstItem ("CutOffDate") |
| Set dtCutOffDate = itemCutOffDate.DateTimeValue |
| vCutOffDate = dtCutOffDate.LSLocalTime |
Wie
bescheuertumständlich war ich damals ?
Das Ganze geht auch in einer Zeile:
vCutOffDate = docSetup.CutOffDate (0)
Mit der Zeit wird man eben weiser - und dafür ist ja auch das Forum da

Dann habe ich mal eine Routine von Ende 2004 herausgesucht, die nach Übergabe zweier NotesItems vom Typ Date/Time die Diffenrenz in Minuten berechnet:
| Name GetTimeDifferenceMin |
| Type Function |
| Parameters vStartTime As Variant |
| vEndTime As Variant |
| Return Type Double |
| |
| Lotuscript |
| '++LotusScript Development Environment:2:1:GetTimeDifferenceMin:1:8 |
| Function GetTimeDifferenceMin (vStartTime As Variant, vEndTime As Variant) As Double |
| '================================================================================================================== |
| ' Purpose: Calculates the time difference between two given Date/Time values (normally the time component only) |
| ' |
| ' Arguments: |
| ' vStartTime - should be a Date / Time value |
| ' vEndTime - should be a Date / Time value. If vEndTime is 0:00 it will be converted to 24:00 (= 1) ! |
| ' |
| ' Returns: The time difference in minutes if both values are Date/Time values (otherwise 0) |
| ' |
| ' Created by: Bernhard Koehler on 13.12.2004 Modified by: |
| ' |
| ' Changes: |
| '================================================================================================================== |
| |
| Dim dblDifference As Double |
| |
| |
| On Error Goto ErrorRoutine |
| |
| 'The default value: |
| GetTimeDifferenceMin = 0 |
| |
| 'Check for valid Date/Time values: |
| If Not (Isdate (vStartTime)) Or Not (Isdate (vEndTime)) Then |
| Exit Function |
| End If |
| |
| 'Because we can't store 24:00 in Notes we use 0:00 and have to convert this value to 24:00 = 1 |
| If vEndTime = 0 Then |
| vEndTime = 1 |
| End If |
| |
| dblDifference = vEndTime - vStartTime |
| |
| dblDifference = dblDifference * 24 * 60 |
| |
| GetTimeDifferenceMin = dblDifference |
| |
| Exit Function |
| |
| ErrorRoutine: |
| GetTimeDifferenceMin = 0 |
| Call ErrorHandler ("GetTimeDifferenceMin") |
| Exit Function |
| End Function |
Dieses Beispiel soll zeigen, wie man auf des Pudels Kern zurückkommt: Datums-/Zeitangaben sind schlichte Double-Zahlen. Wie aber auch schon erwähnt: Wenn es um die Berücksichtigung von Zeitzonen u.ä. geht, dann kann das wohl Notes, aber dafür werden in einem DT-Object dann auch mehr Informationen zur Verfügung gestellt. Unsere schlichte Datumsseriennummer reicht dann nicht mehr !
Also wie immer: Jedes Werkzeug, wo es hingehört.
Bernhard