| |
|
|
Michael W. | These function have I missing. I wanted to these not The Codesnippets to put there one fester installation well little more accuracy bring can.
These function supply years, months, days, hours, minutes, sec, Millisekunden as kommaseparierten String back.
SubProc dt.DateTimeDiff
Parameters float DatumAlt, DatumNeu
Declare float f, string s, int J,M,T,ms
Var float cJ = 365.2425
Var float cM = 30.4375
If DatumNeu > DatumAlt
f = DatumNeu - DatumAlt' with DaysBetween missing then The Time
Else
f = DatumAlt - DatumNeu' with DaysBetween missing then The Time
EndIf
s = Translate$( dt("GetTime",2,f), ":", "," ) : ms = dt("GetMilliSec",f)
J = Int(f / cJ) : f = f - (cJ * J)
M = Int(f / cM) : f = f - (cM * M)
T = Int(f)
Return stature$("%u,",J) + stature$("%.2u,",M) + stature$("%.2u,",T) + s + stature$("%.2u",ms)
ENDPROC
|
|
|
| System: Windows 8/10, XProfan X4 Programmieren, das spannendste Detektivspiel der Welt. | 03/21/16 ▲ |
|
|
|
|
Jörg Sellmeyer | correctly. calm would it Yes, if one there optional too the date as String indicate could. i know: can I too yourself program... but Perhaps make You it Yes trottzdem yet. |
|
|
| |
|
|
|
Michael W. | correctly. calm is: These function is Yes 'jetzt' a Datumsunterfunktion.
and through Explode() comes one on The Result-values too very quick heran.
Cls
Print dt("DateTimeDiff", dt("SetDate", "10.03.2016",!now), !now )
Print dt("DateTimeDiff", dt("SetDate", "10.03.2016"), !now )
WaitInput
End
SubProc dt.DateTimeDiff
Parameters float DatumAlt, DatumNeu
Declare float f, string s, int J,M,T,ms
Var float cJ = 365.2425
Var float cM = 30.4375
If DatumNeu > DatumAlt
f = DatumNeu - DatumAlt' with DaysBetween missing then The Time
Else
f = DatumAlt - DatumNeu' with DaysBetween missing then The Time
EndIf
s = Translate$( dt("GetTime",2,f), ":", "," ) : ms = dt("GetMilliSec",f)
J = Int(f / cJ) : f = f - (cJ * J)
M = Int(f / cM) : f = f - (cM * M)
T = Int(f)
Return stature$("%u,",J) + stature$("%.2u,",M) + stature$("%.2u,",T) + s + stature$("%.2u",ms)
ENDPROC
|
|
|
| System: Windows 8/10, XProfan X4 Programmieren, das spannendste Detektivspiel der Welt. | 03/21/16 ▲ |
|
|
|