English
Forum

DateTimeDiff

 

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.
 
XProfan X3
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
03/21/16  
 




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  
 



Answer


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

10.698 Views

Untitledvor 0 min.
H.Brill11/26/22
Jörg Sellmeyer05/15/18
Michael W.07/31/17
Torsten Rümker05/10/16
More...

Themeninformationen

this Topic has 2 subscriber:

Michael W. (2x)
Jörg Sellmeyer (1x)


Admins  |  AGB  |  Applications  |  Authors  |  Chat  |  Privacy Policy  |  Download  |  Entrance  |  Help  |  Merchantportal  |  Imprint  |  Mart  |  Interfaces  |  SDK  |  Services  |  Games  |  Search  |  Support

One proposition all XProfan, The there's!


My XProfan
Private Messages
Own Storage Forum
Topics-Remember-List
Own Posts
Own Topics
Clipboard
Log off
 Deutsch English Français Español Italia
Translations

Privacy Policy


we use Cookies only as Session-Cookies because of the technical necessity and with us there no Cookies of Drittanbietern.

If you here on our Website click or navigate, stimmst You ours registration of Information in our Cookies on XProfan.Net To.

further Information To our Cookies and moreover, How You The control above keep, find You in ours nachfolgenden Datenschutzerklärung.


all rightDatenschutzerklärung
i want none Cookie