Loading ...
Sorry, an error occurred while loading the content.

Re: julian date

Expand Messages
  • Charles M. Raine
    Hi Claes, Michael & RS: ... No, it certainly is not trivial. I have spent considerable time this morning thinking about such a clip. In my vocation before my
    Message 1 of 5 , Jun 5, 2000
    • 0 Attachment
      Hi Claes, Michael & RS:

      At 02:48 PM 6/5/2000 +0200, you wrote:

      >In fact, I have been thinking to use this to create week numbers. I don't
      >know if this bureaucratic abomination is something that you too suffer
      >from in other countries. Most of our large scale time planning is based on
      >the week number concept. Since it is a totally synthetic concept, I always
      >have to check in my calender whatever is meant by "Week 34". Thus I would
      >like a clip to tell me what week YYYY-MM-DD is, and vice versa.
      >The week number is in Sweden defined like this:
      >- All weeks start on Mondays.
      >- Week number 1 is the first week with 4 or more days in the new year.
      >I don't think it is too difficult to make a clip for this, but it is not
      >trivial.

      No, it certainly is not trivial. I have spent considerable time this
      morning thinking about such a clip. In my vocation before my retirement, I
      spent a lot of time programming, in the area of date calculations for
      financial transactions and am therefore very familiar with the problem.
      NoteTab complicates this to some extent in that it will only give you
      information for the Current date, (particularly the day of the week). As
      yet I have not come up with a simple calculation for Week of the Year, but
      give me some more time. I enjoy this kind of a challenge!

      Below is a modified version of your clip, which I 'personally' find easier
      and quicker to use than your version. One nice advantage to it is, that if
      you hit OK to the wizard, it automatically tells you the days for the
      current date. I had just finished using a similar Edit Mask in another clip
      which I just completed for something else. You will also notice that I am
      partial to using arrays, whenever possible.

      ---------< start clip >---------
      H="Day of Year"
      ; Charles M. Raine < rainec@... >
      ; 06/05/2000, 02:09:41 PM
      ^!Set %date%=^$GetDate(yyyy-mm-dd)$
      ^!Set %date%=^?{(M="0000-00-00;1;*")Modify Date as Required=^%date%}
      ^!SetArray %adate%=^$StrReplace("-";";";"^%date%";n;n)$
      ^!If "^%adate2%"<"10" Next ELSE Skip
      ^!Set %adate2%=^$StrReplace("0";"";"^%adate2%";n;n)$
      ^!Setarray %mdays%=0;31;59;90;120;151;181;212;243;273;304;334
      ^!If ^$Calc(^%adate1%mod4)$ <> 0 skip_1
      ^!If ^%adate2%>2 ^!Inc %adate3%
      ^!Set %dayofy%=^$Calc(^%mdays^%adate2%%+^%adate3%)$
      ^!Info Day of the year: ^%dayofy%
      ---------< end clip >-----------


      Charlie.

      Charles M. Raine Home Page: http://www.escape.ca/~rainec
      Phone (204) 895-0940 ICQ # 300058
      Winnipeg, Manitoba, Canada
    Your message has been successfully submitted and would be delivered to recipients shortly.