logo
Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Ben_Zurich  
#1 Posted : Saturday, January 27, 2007 5:40:07 PM(UTC)
Ben_Zurich

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/4/2006(UTC)
Posts: 57
Location: Zurich, Switzerland


Help,

is there any way I could display / (or, refer to within an indicator)
to each current date in the "Excel" count format: e.g. 12/31/03 = 37986 ?

I need would need this number (NOT the date in MMDDYYYY)
- it is the number of days since 01/01/1900.

Thank you for any hint to accomplish this.

Best, Ben

Ben_Zurich  
#2 Posted : Saturday, January 27, 2007 5:52:42 PM(UTC)
Ben_Zurich

Rank: Advanced Member

Groups: Registered, Registered Users, Subscribers
Joined: 7/4/2006(UTC)
Posts: 57
Location: Zurich, Switzerland

Sorry, for bothering you guys, I just found it on José's Webpage. Sorry for bothering you guys.

Thank's José, this might be of great help.
For anybody else whom might run into this problem:



====================
Calendar Day counter
====================
---8<---------------------------

{Day counter from 1/1/0001, Gregorian calendar.
Count is independent of any missing chart data.

©Copyright 2003~2006 Jose Silva.
The grant of this license is for personal use
only - no resale or repackaging allowed.
All code remains the property of Jose Silva.
http://www.metastocktools.com }

{ User input }
limit:=Input("count calendar days from year",1,2200,2000);

{ Day counter }
LimLeap:=Frac(limit/4)=0 AND Frac(limit/100)<>0
OR Frac(limit/400)=0;
NoCount:=limit*365+Int(limit/4)
-Int(limit/100)+Int(limit/400)-LimLeap;
leap:=Frac(Year()/4)=0 AND Frac(Year()/100)<>0
OR Frac(Year()/400)=0;
y:=Year()*365+Int(Year()/4)
-Int(Year()/100)+Int(Year()/400)-NoCount;
m:=
If(Month()=2,31-leap,
If(Month()=3,59,
If(Month()=4,90,
If(Month()=5,120,
If(Month()=6,151,
If(Month()=7,181,
If(Month()=8,212,
If(Month()=9,243,
If(Month()=10,273,
If(Month()=11,304,
If(Month()=12,334,
-leap)))))))))));
DayNr:=y+m+DayOfMonth();

{ Plot in own window }
DayNr

---8<---------------------------


http://www.metastocktools.com


Users browsing this topic
Guest (Hidden)
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.