Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Julian date
Message
From
10/08/2004 08:18:33
 
 
To
09/08/2004 05:31:04
Ashish Patel
Hindustan Petroleum
Mumbai, India
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00931697
Message ID:
00931999
Views:
17
>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
Previous
Reply
Map
View

Click here to load this message in the networking platform