Post Reply 
Daylight Saving
03-30-2014, 05:48 PM
Post: #1
Daylight Saving
Should the Prime be able to implement a DST correction ;-) (And if so, for what location!)
Find all posts by this user
Quote this message in a reply
03-31-2014, 12:09 AM
Post: #2
RE: Daylight Saving
(03-30-2014 05:48 PM)ColinJDenman Wrote:  Should the Prime be able to implement a DST correction ;-) (And if so, for what location!)

There are so many possible DST corrections (zone, date, location) ... I'd first suggest a simple "DSTahead: add DST-offset to current time" and "DSTback: subtract DST-offset from current time" where DST-offset is a user global set by the user. DSTahead and DSTback would be executed by the user. (At the moment, I believe the possible values would be 0, 60, 90, or 120 minutes, but I haven't looked recently.)

Time zone changes are also possible and a further mess. While there are 24 obvious time zones, in practice there are more, not all of which are an integer number of hours from UTC.

If you want, then something much more complex could be coded, the Wikipedia article on Daylight Savings Time has the beginnings of the details.

Not trying to discourage you, just how complicated the task is!
Find all posts by this user
Quote this message in a reply
03-31-2014, 02:45 AM (This post was last modified: 03-31-2014 02:46 AM by Tim Wessman.)
Post: #3
RE: Daylight Saving
Well, the simplest solution I can think of is simply NOT to do any sort of time and date automation!

Essentially, we made a decision early on that we'd leave the time completely up to the user apart from a few simple options. Each time you connected to the connkit it will sync the time immediately with whatever the computer is running. Since it is a fairly safe assumption that the computer will be correct, I think that is probably the best way to do it easily.

TW

Although I work for the HP calculator group, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
03-31-2014, 04:50 AM
Post: #4
RE: Daylight Saving
PCs are traditionally set to local time (or local daylight time) or UTC; that approach is safe until you link to a PC set differently than the Prime.
Find all posts by this user
Quote this message in a reply
04-01-2014, 09:26 PM (This post was last modified: 04-01-2014 09:31 PM by ColinJDenman.)
Post: #5
RE: Daylight Saving
I think a simple format like the Unix TZ database entry
GMT0BST,M3.5.0/1,M10.5.0 // British Summer Time, starts last Sunday in March, ends in October
would be sufficient, then print a table of strings in the manual, or a drop-down list in settings. The code can be gleaned from bumerous implementations. It would certainly be more complicated to keep a graphical map, and also, in my experience, far more fiddly on a small screen. And for goodness sake keep the internal clock UTC, only make the TZ apply when displaying a date/time.

Let's not forget the Prime is essentially an under-specified smartphone with a nice(-ish: bad colours) keyboard. As such, my budget £30 Alcatel onetouch 903 does rather wizzy 3d graphing (Using free Arity app), though the 'keyboard' is painful.
Find all posts by this user
Quote this message in a reply
04-02-2014, 09:42 PM
Post: #6
RE: Daylight Saving
Speaking of DST...

Any plans to implement a set of functions for time calculation/manipulation? Preferably with DST supported and some kind of a subset (or, heck, even full set) of the Tz database?

I know that's not something you'd want or need in an education market machine, but it's a really useful thing to have in a toolkit.
Find all posts by this user
Quote this message in a reply
04-03-2014, 01:11 AM
Post: #7
RE: Daylight Saving
On any Unix style system, the man pages for tzfile and tzset will give the details on how UTC time (which is what the machine's real time clock always uses) is changed to local time given the current time, date, and political region.

I'm not sure, but I believe that the tzfile is the most frequently updated software component under Linux. It changes every time a political entity somewhere modifies its local rules for daylight savings adjustments.

Long ago, the famed science/SF author Arthur C. Clarke predicted that one day people everywhere would dump local time and switch to UTC (then called GMT) for everyday usage. Perhaps this prediction, from the same person who predicted the Web and a tablet browser thirty years ahead of its invention, may yet come true.
Find all posts by this user
Quote this message in a reply
04-03-2014, 03:55 AM
Post: #8
RE: Daylight Saving
Okay, then how about having DATE+ and DDAYS at least? Smile
Find all posts by this user
Quote this message in a reply
04-03-2014, 11:49 PM
Post: #9
RE: Daylight Saving
Amongst other things said:

(04-03-2014 01:11 AM)Frozen North Wrote:  I believe that the tzfile is the most frequently updated software component under Linux.

Perhaps, but a lot of the data is to support graphical selections and the like. The essential and old part is the string I mentioned previously. This gives all the information for TZ correction to operate. It would simply need to be typed in to a settings box and consulted by relevant time/date output routines. I think putting that onus on an owner is fair, given as you say the rather frequent changes in national policies.

The connectivity kit could certainly encompass the setting update.

On the calendar functions front I'd like to see more. It would certainly come in handy for some science data work, especially in astronomy, as well as opening up diary/reminder features (why oh why doesn't the chip sound output connect to anything????).

I do think any emphasis on 'education' marketing is far too limiting. The company blurb describes the Prime as "The calculator you’ll want to hold on to". Until you leave school perhaps?
Find all posts by this user
Quote this message in a reply
04-04-2014, 01:33 AM
Post: #10
RE: Daylight Saving
(04-03-2014 11:49 PM)ColinJDenman Wrote:  On the calendar functions front I'd like to see more. It would certainly come in handy for some science data work, especially in astronomy, as well as opening up diary/reminder features (why oh why doesn't the chip sound output connect to anything????).

+1 to the above (minus the sound output comment - i don't really need notifications on a calculator, i can set them up on a phone or any number of other, louder devices).
Find all posts by this user
Quote this message in a reply
04-04-2014, 01:48 AM
Post: #11
RE: Daylight Saving
I don't have DATE+ or DDAYS, but how about these for a start?

Code:
EXPORT DJ(X)
BEGIN
LOCAL yy,ddd,mi,mm,dd;
yy:=iquo(10000*X+14780,3652425);
ddd:=X-(365*yy+iquo(yy,4)-iquo(yy,100)+iquo(yy,400));
IF (ddd<0) THEN
  yy:=yy-1;
  ddd:=X-(365*yy+iquo(yy,4)-iquo(yy,100)+iquo(yy,400));
END;
mi:=iquo(100*ddd+52,3060);
mm:=(mi+2) MOD 12 + 1;
yy:=(yy+iquo(mi+2,12));
dd:=ddd-iquo(mi*306+5,10)+1;
RETURN yy+(mm/100)+(dd/10000);
END;

This converts a Julian date (a serial number) to a date in the form of YYYY.MMDD (the Prime format), for example 735628 will return 2014.0403 (April 3, 2014).

And this:
Code:
EXPORT JD(X)
BEGIN
LOCAL yy,mm,dd,rr;
yy:=IP(X);
mm:=IP(100*FP(X));
dd:=100*FP(100*X));
mm:=(mm+9) MOD 12;
yy:=yy-iquo(mm,10);
rr:=365*yy+iquo(yy,4)-iquo(yy,100)+iquo(yy,400)+iquo(mm*306+5,10)+(dd-1);
RETURN rr;
END;

This gives you the Julian date from an input date in the form of YYYY.MMDD.

David Motto
Find all posts by this user
Quote this message in a reply
04-04-2014, 01:55 AM (This post was last modified: 04-04-2014 01:58 AM by ColinJDenman.)
Post: #12
RE: Daylight Saving
(04-04-2014 01:33 AM)orcinus Wrote:  (minus the sound output comment - i don't really need notifications on a calculator, i can set them up on a phone or any number of other, louder devices).

I was also thinking of the math<-->music possibilities. There used to be an interesting program on Windows (Musinum) for generating music from the parity of numbers. I think it an interesting area for exploring curiosity, which is what I tend to use the Prime for.

Got to keep the old gray matter running in old age :-)
Find all posts by this user
Quote this message in a reply
04-04-2014, 06:29 AM
Post: #13
RE: Daylight Saving
Quote:The connectivity kit could certainly encompass the setting update.
Both the CK (automatically) and libhpcalcs (if the set time operation is triggered) reset the time to the computer's local time, but maybe you'd want an UI to set the time to another timezone, or even an arbitrary value ?
Find all posts by this user
Quote this message in a reply
04-04-2014, 07:22 AM
Post: #14
RE: Daylight Saving
(04-04-2014 06:29 AM)debrouxl Wrote:  
Quote:The connectivity kit could certainly encompass the setting update.
Both the CK (automatically) and libhpcalcs (if the set time operation is triggered) reset the time to the computer's local time, but maybe you'd want an UI to set the time to another timezone, or even an arbitrary value ?

Yes, I'm suggesting the host software could include the functionality to set a chosen TZ string on the calculator settings, quite separate from syncing the clock (which would need to be corrected to UTC rather than local time for this idea to work). Any host program is likely to have the relevant information to hand, whether Windows or Unix or anything else.

In some respects, I'd expect the exam mode stuff to handle clock syncing across potential multiple TZs if it is ever intended to operate in large geographically dispersed 'classrooms'.
Find all posts by this user
Quote this message in a reply
04-04-2014, 07:27 AM
Post: #15
RE: Daylight Saving
(04-04-2014 01:48 AM)DGM Wrote:  I don't have DATE+ or DDAYS, but how about these for a start?

Great. I might even dig out my old Meuss Astronomical Algorithms!
Also there is probably some stuff in HP41/50 libraries that might be recycled.
Find all posts by this user
Quote this message in a reply
04-04-2014, 01:54 PM
Post: #16
RE: Daylight Saving
(04-04-2014 01:48 AM)DGM Wrote:  I don't have DATE+ or DDAYS, but how about these for a start?

Awesome work! Thanks Smile
Find all posts by this user
Quote this message in a reply
04-04-2014, 06:36 PM
Post: #17
RE: Daylight Saving
Remember to keep track of the date changes as you shift time zones (for here and there and home and GMT.)
Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 1 Guest(s)