At 06:32 PM 18/01/2002 -0600, Thomas Christopher wrote:
>You might look at how the Python library handles times (including
>time zones). I've attached their html documentation page.

Having just a productive 5 minutes discovering in the Unicon manual how 
many other time/date functions there are that Icon doesn't have, I strongly 
suspect Unicon needs a better complement of time/date functions (there's no 
equivalent apparent to Unix's mktime(), for instance). However, having also 
just spent a week, on and off, working with time/date manipulation 
functions in C and PHP, I think Unicon would be best served with a 
time/date class that you can setup with a string (e.g. &dateline), number 
(e.g. &now) or possibly a table (think tm_struct) and can be modified with 
and can return any of the same upon request.

Timezone should naturally have at least two representatives in a 
table-representative of a date-time-stamp: name and offset. This is what 
Clint proposed adding to &dateline and is what Unix's strftime() does with 
a %z.

I noticed that PHP - and Python, too (thanks Thomas) - seem to burden 
programmers with the raw C calls, even though both languages have better 
native types to work with than C and could have built something easier to 
use on top of them. I also know the IPL has a collection of date/time 
functions. Perhaps they need updating... 
http://yceran.org/stuff/files/datetimeclass.icn is a first attempt at a 
datetime class for Unicon. I've only checked it compiles ('twas a busy day 
today). Feel free to modify/improve/incorporate into the IPL/point out 
someone's already done one/etc. I pinched two routines from 
ipl/procs/datetime.icn so I don't know how it handles out-of-range values. 
I had in mind to add some methods like addMonth but haven't gotten to it 
yet. And asString should know about country-types, if possible.

Wade.



>---
>Thomas W. Christopher, [EMAIL PROTECTED]
>http://tc.toolsofcomputing.com --- books (through Prentice Hall PTR):
>High-Performance Java Platform Computing, ISBN: 0130161640
>Web Programming in Python, ISBN: 0-13-041065-9
>Python Programming Patterns, ISBN: 0-13-040956-1
>
>
>
>
>----- Original Message -----
>From: "Clint Jeffery" <[EMAIL PROTECTED]>
>To: <[EMAIL PROTECTED]>
>Cc: <[EMAIL PROTECTED]>
>Sent: Friday, January 18, 2002 3:12 PM
>Subject: Re: [Unicon-group] Timezone
>
>
> > OK, let's pretend for a moment that we own the language and can add
> > anything we want to it. :-)
> >
> > What should our portable timezone information look like at the language
> > level?  Should one of the existing keywords include timezone information?
> > Should there be a new keyword?  Are there a standard set of strings
> > worldwide for this?
> >
> > I have not studied how to get the information under Windows, although I
> > suspect it will be moderately easy, and that it might involve a call to
> > GetTimeZoneInformation().
> >
> > Clint
> >
> > _______________________________________________
> > Unicon-group mailing list
> > [EMAIL PROTECTED]
> > https://lists.sourceforge.net/lists/listinfo/unicon-group
> >

Wade Bowmer <[EMAIL PROTECTED]>
         "All around me are nothing but fakes
         Come with me on the biggest fake of all!"


_______________________________________________
Unicon-group mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/unicon-group

Reply via email to