Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Julian date
Message
De
10/08/2004 08:18:33
 
 
À
09/08/2004 05:31:04
Ashish Patel
Hindustan Petroleum
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00931697
Message ID:
00931999
Vues:
19
>I am using Visual Foxpro 6.0 and I want to convert Julain Date (format CYYDDD : C = Century, YY = Year, DDD = Days 1 to 366) to dd/mm/yyyy. Pl. Help. Thanks in Advance.
* function cvtyyyydddd2date(tcYYYYDDD)
* by the late Ed Rauh
lparameters tcYYYYDDD

assert pcount() = 1 and vartype(tcYYYYDDD) = "C" and len(tcYYYYDDD) = 7 ;
	message "Wrong parameter passed! cvtyyyydddd2date(tcYYYYDDD)"

if pcount() = 0 or vartype(tcYYYYDDD) != "C" or len(tcYYYYDDD) != 7
	return {}		&& return empty date
endif

LOCAL nDays
nDays = VAL(SUBST(tcYYYYDDD,5))
RETURN EVAL("{^" + LEFT(tcYYYYDDD,4) + "-01-01}") + nDays - 1


Alex Feldstein, MCP, Microsoft MVP
VFP Tips: English - Spanish
Website - Blog - Photo Gallery


"Once again, we come to the Holiday Season, a deeply religious time that each of us observes, in his own way, by going to the mall of his choice." -- Dave Barry
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform