I need to know which of the 365 (or 366) days of the year today is. I have searched for Julian Date but the one page I found with a formula is oftly complex. This conceptually should be east but I can't figure it out. Please help.
DayOfYear(MyDate : Date) : Integer
EVALUATE(FirstDay,'12/31/' + FORMAT((DATE2DMY(MyDate,3)-1)));
// -1 to get last day of previous year
EXIT(MyDate - FirstDay);
DayOfYear(MyDate : Date) : Integer
EVALUATE(FirstDay,'12/31/' + FORMAT((DATE2DMY(MyDate,3)-1)));
// -1 to get last day of previous year
EXIT(MyDate - FirstDay);
Works for leap years too.
Steve
What's FirstDay? It's not a command I know of and the code doesn't work as is.
this function FORMAT(TODAY,0,'<weekday text>') returns the day name of the week, like Monday, Tuesday , etc. We were trying to find the day of the year like day 267 of 365.
steve
:evil: :evil:
Sorry, but I'm tired to think about this: I need to obtain the first and the last day of the next year, starting from a given date...
e.g.: with 15/02/07 i need 01/01/08 and 31/12/08
It's not a difficult problem, but I'm thinkin' and thinkin' the same thins and I won't get out of this hell alone... :evil: :evil:
Thanks!
-Mirko-
"Never memorize what you can easily find in a book".....Or Mibuso My Blog
Comments
if you view-> source from your browser you can see the formula they use to calculate the number.
maybe this can point you in the right direction.
& you can use this if you want to create something like the web page
http://www.mibuso.com/dlinfo.asp?FileID=518
Here is a formula for finding the day of the week for ANY date.
N = d + 2m + [3(m+1)/5] + y + [y/4] - [y/100] + [y/400] + 2
read this:
http://mathforum.org/library/drmath/view/55837.html
You can always search google for
"day number of the year formula"
or
"Julian Day Number Calculator"
http://www.BiloBeauty.com
http://www.autismspeaks.org
Works for leap years too.
Steve
What's FirstDay? It's not a command I know of and the code doesn't work as is.
FirstDay is a local Variable of datatype Date
It could be called LastDay too, if that makes the code clearer
Steve
j1:=EVALUATE(FirstDay,'12/31/' + FORMAT((DATE2DMY(today,3)-1)));
jday:=today-FirstDay;
http://www.BiloBeauty.com
http://www.autismspeaks.org
Format(today, 0, '<Weekday Text>')
steve
http://www.mibuso.com/dlinfo.asp?FileID=1123
here calcdate returns start of the year date (Jan 1st)
Sorry, but I'm tired to think about this: I need to obtain the first and the last day of the next year, starting from a given date...
e.g.: with 15/02/07 i need 01/01/08 and 31/12/08
It's not a difficult problem, but I'm thinkin' and thinkin' the same thins and I won't get out of this hell alone... :evil: :evil:
Thanks!
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
This topic is an inspiration!!Thanks BTW
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog
EUGENE
what's wrong in my code? if i want I can write
and that's right! #-o #-o #-o
"Never memorize what you can easily find in a book".....Or Mibuso
My Blog