English
Source / code snippets

date functions Getdate Calendar

 

Jörg
Sellmeyer
The Datumsfunktionen in XProfan are (find I) not integrally slight To durchschauen. Also is the Syntax something ...hrm... umständlich.
with a couple own Procedures can from it but speedy and übersichtliche Terminfunktionen produce:
Proc yesterday

    Return Dt("getDate",0,dt("incDay",!now,-1))

ENDPROC

Proc tommorrow

    Return Dt("getDate",0,dt("incDay",!now,1))

ENDPROC

'the first both Procedures only from Found the comfort drin.
'one can also The Proc today with suitable Parameters +1/-1 Call.
'meaningfully would z. B., these both Procedures in a Headerdatei To write:
'MORGEN = Dt("getDate",0,dt("incDay",!now,1));
'GESTERN = Dt("getDate",0,dt("incDay",!now,-1));
'appeal then with: Print ~MORGEN
'one could here naturally yet a optionalen Parameter for the Ausgabeformat install.
'the Have I but from Found the better Übersichtlichkeit let.

Proc today

    If %pcount = 1

        Parameters i%

    ElseIf %pcount = 2

        Parameters date$,i%

    Else

        Var i% = 0

    EndIf

    Return Dt("getDate",0,dt("incDay",!now,i%))

ENDPROC

Proc DatumPlus

    Parameters d%,m%,j%,d$
    Declare Date!

    If %pcount = 3

        'if no date indicated becomes, becomes the "Heute" uses
        date! = !now

    ElseIf %pcount = 4

        date! = Dt("setDate",d$)

    EndIf

    Date! = dt("incDay",date!,d%)
    Date! = dt("incMonth",date!,m%)
    Date! = dt("incYear",date!,j%)
    Return Dt("getDate",0,Date!)

ENDPROC

Proc DatumIntervall

    Parameters D$,I%,amount%
    Var date! = Dt("setDate",D$)

    WhileLoop 1,amount% * I%,I%

        Print Dt("getDate",0,dt("incDay",date!,&Loop)),&loop
        'here would a spending z. B. into Listboxliste naturally sinnvoller
        'AddStrings Dt("getDate",0,dt("incDay",date!,d%))

    Wend

ENDPROC

Print "Gestern was " + yesterday()
Print "Heute is " + today()
Print "Morgen is " + tommorrow()
Print
Print "Vor 5 Meet was the " + today(-5)
Print "In 50 Meet is the " + today(50)
Print
Print "In 10 Meet, 6 Monaten and 12 years is the " + DatumPlus(10,6,12)
Print "Vor 10 Meet, 6 Monaten and 12 years was the " + DatumPlus(-10,-6,-12)
Print "und the goes too with a beliebigen date: " + DatumPlus(1,-6,2,"02.05.1999")
Print
Print "Taste drücken"
WaitKey
Print
Print "Eine list with 14-daily Terminen ex the 15.5.2013"
DatumIntervall("15.5.2013",14,10)
WaitInput
WaitInput
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
03/07/13  
 



On each drop meaningfully.

How is with the date->Zeitstempel?
 
03/07/13  
 




Jörg
Sellmeyer
What exactly Dou you mean with Zeitstempel? the here:

gives you z. B. a english spending with Offset to UTC from.
If you one bestimmtes Ausgabeformat having want, gib time an example what about me bastel what together.
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
03/07/13  
 



I mean whom undertow. Unix Timestamp:  [...] 

means amount past sec since 01.01.1970 00:00.00 UTC.

In nProcs can simply:

write:  [...] 
 
03/07/13  
 




Jörg
Sellmeyer
Should Yes in the principle something like How that here his:
Var UTC! =  Dt("setDate","01.01.1970")
Print (!Now - UTC!) * 24 * 60 * 60
WaitInput
 
Windows XP SP2 XProfan X4
... und hier mal was ganz anderes als Profan ...
03/07/13  
 



Zum Quelltext


Topictitle, max. 100 characters.
 

Systemprofile:

no Systemprofil laid out. [anlegen]

XProfan:

 Posting  Font  Smilies  ▼ 

Please register circa a Posting To verfassen.
 

Topic-Options

11.235 Views

Untitledvor 0 min.
Erhard Wirth06/14/24
ecki02/10/23
Michael W.03/30/22
Thomas Zielinski12/02/21
More...

Themeninformationen

this Topic has 2 subscriber:

Jörg Sellmeyer (3x)
iF (2x)


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