Startseite
Downloads
Lexikon
Sonstiges
Links
Kontakt
Gästebuch
Statistics
Disclaimer
Syntax
jDate = JulDate( [convDate[, convFormat]] ) [;]
Beschreibung
Konvertieren eines Datums im Format der REXX-Funktion Date() (dd Mmm jjjj) in das julianische Format jjjj.ddd.
Aufrufparameter
Parameter
Beschreibung
convDate
Das Datum zum Konvertieren.
convFormat
Format, in dem das Datum convDate, zur Verfügung steht.
Standardwerte
Parameter
Wert
convDate
Das aktuelle Datum (heute).
convFormat
"N".
Rückgabewerte
Bedeutung
julDate
Datum im julianischem Format mit vorangestelltem 4-stelligem Jahr: jjjj.ddd).
Bemerkungen
Der Eingabeparameter convFormat muss eine gültige Option der REXX-Funktion Date() sein, die das zu umsetzende Format beschreibt.

Sourcecode

/*=======( Umwandeln eines Datums ins julianische Format )=======*/
JulDate: Procedure
Parse Arg targetDate, targetFormat

If targetFormat = '' Then targetFormat = "N"
If targetDate = '' Then targetDate = Date( targetFormat )

Parse Value Date( "N", targetDate, targetFormat ) With . . jjjj .
ddd = Right( Date( "D", targetDate, targetFormat ), 3, "0" )

/* For Mainframe replace "||" in the next line by "!!": */
Return jjjj || "." || ddd
/*** End JulDate ***/

Beispiel 1

julDate = JulDate()
Say julDate

Ergebnis 1

2006.352   /* erstellt am 18.12.2006 */

Beispiel 2

julDate = JulDate( , "S" )
Say julDate

Ergebnis 2

2006.352   /* erstellt am 18.12.2006 */

Beispiel 3

julDate = JulDate( "20010211", "S" )
Say julDate

Ergebnis 3

2001.042

Beispiel 4

julDate = JulDate( "22 Jul 2002" )
Say julDate

Ergebnis 4

2002.203
Your privacy: This web site has no cookies, no advertising and does not provide access data to anyone for any reason.
Copyright © Janosch R. Kowalczyk 1999, 2010. All rights reserved.
Most recent revision on 25 Feb 2010 (56) - 13:22:30.
Jakoxx Logo