Re: [Zope] Date utility for Zope (V2)

2010-11-10 Thread Lennart Regebro
On Wed, Nov 10, 2010 at 02:00, Brian Sullivan briansulli...@gmail.com wrote:
 I guess I having a mental block then. To use it from what I know I
 would have create a Zope 2 product from it somehow or create callable
 scripts in the ZMI from the provided code. Neither seems reasonable.

 Is there other way to use the code that I am not understanding?

Well, you need to do something with the rrules, yes. And that
obviously needs to be done in some sort of Zope product. And you will
need to write that, so it does what you want it to do.

But the dtutil module itself you simply use from Python like this:

from dtutil import rrule
rrule.whatevereblahlahlah()


I have the feeling (but I could be wrong) that there is a very long
distance from what you want to what you say you want. Maybe you can
explain what you actually want to do, your usecases etc.

--
Lennart Regebro, Colliberty: http://www.colliberty.com/
Telephone: +48 691 268 328
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Date utility for Zope (V2)

2010-11-10 Thread Brian Sullivan
I have recurring events that I want to schedule (the events are
sending email, Twitter DMs and Facebook messages -- at least those are
the possible ones that I have identified so far). I need some flexible
way to both specify the intervals and interpret the intervals so that
the next event in a sequence can be specified in real time terms and
scheduled.

The event schedule at least in plain English could be something like 
every weekday at 8:45, every Monday at 9:00 and 1:00, every day at
2:00, the first of every month at 9:00, every other Monday. I
realize that I may have to settle for something that is not quite as
flexible as I imagine and at least for now I am just trying to see if
someone else has solved this problem or one similar and has something
I can use as a base.

I do have a way to trigger and execute the events at specific times.

On Wed, Nov 10, 2010 at 5:00 AM, Lennart Regebro rege...@gmail.com wrote:
 On Wed, Nov 10, 2010 at 02:00, Brian Sullivan briansulli...@gmail.com wrote:
 I guess I having a mental block then. To use it from what I know I
 would have create a Zope 2 product from it somehow or create callable
 scripts in the ZMI from the provided code. Neither seems reasonable.

 Is there other way to use the code that I am not understanding?

 Well, you need to do something with the rrules, yes. And that
 obviously needs to be done in some sort of Zope product. And you will
 need to write that, so it does what you want it to do.

 But the dtutil module itself you simply use from Python like this:

 from dtutil import rrule
 rrule.whatevereblahlahlah()


 I have the feeling (but I could be wrong) that there is a very long
 distance from what you want to what you say you want. Maybe you can
 explain what you actually want to do, your usecases etc.

 --
 Lennart Regebro, Colliberty: http://www.colliberty.com/
 Telephone: +48 691 268 328

___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Date utility for Zope (V2)

2010-11-10 Thread Lennart Regebro
On Wed, Nov 10, 2010 at 15:25, Brian Sullivan briansulli...@gmail.com wrote:
 I have recurring events that I want to schedule (the events are
 sending email, Twitter DMs and Facebook messages -- at least those are
 the possible ones that I have identified so far).

Right, so you need to make these events as you normally write your applications.

 I need some flexible
 way to both specify the intervals and interpret the intervals so that
 the next event in a sequence can be specified in real time terms and
 scheduled.

And that's what dateutil.rrule is for.

--
Lennart Regebro, Colliberty: http://www.colliberty.com/
Telephone: +48 691 268 328
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Date utility for Zope (V2)

2010-11-10 Thread Brian Sullivan
I had a look at tutorials to create products for Zope2 and at first
glance they are beyond by pay grade.

Maybe I will look at them more closely to see if I might have been
hasty but likely it will be easier for me and take less time just to
write what I need in script and forgo the I would like to do stuff.

Regardless thanks for the help.

On Wed, Nov 10, 2010 at 5:30 PM, Lennart Regebro rege...@gmail.com wrote:
 On Wed, Nov 10, 2010 at 15:25, Brian Sullivan briansulli...@gmail.com wrote:
 I have recurring events that I want to schedule (the events are
 sending email, Twitter DMs and Facebook messages -- at least those are
 the possible ones that I have identified so far).

 Right, so you need to make these events as you normally write your 
 applications.

 I need some flexible
 way to both specify the intervals and interpret the intervals so that
 the next event in a sequence can be specified in real time terms and
 scheduled.

 And that's what dateutil.rrule is for.

 --
 Lennart Regebro, Colliberty: http://www.colliberty.com/
 Telephone: +48 691 268 328

___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Date utility for Zope (V2)

2010-11-09 Thread Lennart Regebro
On Tue, Nov 9, 2010 at 22:12, Brian Sullivan briansulli...@gmail.com wrote:
 On another forum this http://labix.org/python-dateutil was suggested
 -- it looks to be close to what I was thinking --

I second that.

 but I am not totally
 sure how I can use it in Zope (a level of incompetence issue no
 doubt).

You would use it as you would use it outside Zope. No difference, it's
just all Python.

//Lennart
___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Date utility for Zope (V2)

2010-11-09 Thread Brian Sullivan
I guess I having a mental block then. To use it from what I know I
would have create a Zope 2 product from it somehow or create callable
scripts in the ZMI from the provided code. Neither seems reasonable.

Is there other way to use the code that I am not understanding?


On Tue, Nov 9, 2010 at 6:11 PM, Lennart Regebro rege...@gmail.com wrote:
 On Tue, Nov 9, 2010 at 22:12, Brian Sullivan briansulli...@gmail.com wrote:
 On another forum this http://labix.org/python-dateutil was suggested
 -- it looks to be close to what I was thinking --

 I second that.

 but I am not totally
 sure how I can use it in Zope (a level of incompetence issue no
 doubt).

 You would use it as you would use it outside Zope. No difference, it's
 just all Python.

 //Lennart

___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Date utility for Zope (V2)

2010-11-09 Thread robert rottermann
Am 10.11.2010 02:00, schrieb Brian Sullivan:
 I guess I having a mental block then. To use it from what I know I
 would have create a Zope 2 product from it somehow or create callable
 scripts in the ZMI from the provided code. Neither seems reasonable.

 Is there other way to use the code that I am not understanding?
it is enough to create an external python script.
this is a normal python script that has to reside in
YOUR ZOPEINSTANCE/parts/instance/Extentions

you can do what ever you like in such a script.
there are no restrictions (that I know of).

robert

 On Tue, Nov 9, 2010 at 6:11 PM, Lennart Regebrorege...@gmail.com  wrote:
 On Tue, Nov 9, 2010 at 22:12, Brian Sullivanbriansulli...@gmail.com  wrote:
 On another forum this http://labix.org/python-dateutil was suggested
 -- it looks to be close to what I was thinking --
 I second that.

 but I am not totally
 sure how I can use it in Zope (a level of incompetence issue no
 doubt).
 You would use it as you would use it outside Zope. No difference, it's
 just all Python.

 //Lennart

 ___
 Zope maillist  -  Zope@zope.org
 https://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
   https://mail.zope.org/mailman/listinfo/zope-announce
   https://mail.zope.org/mailman/listinfo/zope-dev )

___
Zope maillist  -  Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 https://mail.zope.org/mailman/listinfo/zope-announce
 https://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] date problem

2005-09-27 Thread Peter Bengtsson
No doubt a Zope 2.8.0 bug because it should't happen.
What does your datetime-format say in etc/zope.conf?

2005/12/02 is an ISO format I think. Exactly how are you creating
the DateTime object? Have you tried creating it from this string:
2005-12-02?

2005/9/27, tyson [EMAIL PROTECTED]:
 Hi-
I upgraded from (Zope 2.7.3-0, python 2.3.4, linux2) to (Zope
 2.8.0-final, python 2.4.1, linux2).  If I use the fmt=%m/%d, then
 the date is incorrect.   If I don't use the fmt, then my date is
 logically correct, just not formatted the way I want it.  For some
 reason when I use the fmt with the zope variable, it changes my date
 to exactly one day earlier.  For example:

 SomeDate = 2005/12/02

 If I write this code:
dtml-var SomeDate fmt=%m/%d/%Y
 Then I get:
12/01/2005

 If I write this code:
   dtml-var SomeDate
 Then I get:
   2005/12/02

 Does anybody have an idea what this could be from?  I'm guessing its a
 python2.4 conflict, but not really sure.
 Any help would be much appreciated!



 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )



--
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] date formatting

2005-08-29 Thread Peter Bengtsson
If dtml-var ZopeTime fmt=Day but
dtml-var foo fmt=Day doesn't then there's nothing wrong with how
you're using the fmt parameter but something is wrong with foo.
Try::

 dtml-var foo.strftime('Day')

On 8/29/05, garry saddington [EMAIL PROTECTED] wrote:
 I am trying to format a dtml-var date by using fmt=Day
  dtml-var foo fmt=Day returns error: Error Type: TypeError
 Error Value: not all arguments converted during string formatting
 
 while dtml-var ZopeTime fmt=Day works fine.
 
 The date is International format and I have Zope set up to parse
 international dates.
 Does anyone know where I am going wrong?
 regards
 garry
 
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )
 


-- 
Peter Bengtsson, 
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] date formatting

2005-08-29 Thread garry saddington
On Mon, 2005-08-29 at 14:51 +0100, Peter Bengtsson wrote:
 If dtml-var ZopeTime fmt=Day but
 dtml-var foo fmt=Day doesn't then there's nothing wrong with how
 you're using the fmt parameter but something is wrong with foo.
 Try::
 
  dtml-var foo.strftime('Day')
this gives the following error: 'str' object has no attribute strftime 
regards
garry

 
 On 8/29/05, garry saddington [EMAIL PROTECTED] wrote:
  I am trying to format a dtml-var date by using fmt=Day
   dtml-var foo fmt=Day returns error: Error Type: TypeError
  Error Value: not all arguments converted during string formatting
  
  while dtml-var ZopeTime fmt=Day works fine.
  
  The date is International format and I have Zope set up to parse
  international dates.
  Does anyone know where I am going wrong?
  regards
  garry
  
  ___
  Zope maillist  -  Zope@zope.org
  http://mail.zope.org/mailman/listinfo/zope
  **   No cross posts or HTML encoding!  **
  (Related lists -
   http://mail.zope.org/mailman/listinfo/zope-announce
   http://mail.zope.org/mailman/listinfo/zope-dev )
  
 
 

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] date formatting

2005-08-29 Thread Peter Bengtsson
That means that 'foo' is NOT a DateTime object like ZopeTime is. 

On 8/29/05, garry saddington [EMAIL PROTECTED] wrote:
 On Mon, 2005-08-29 at 14:51 +0100, Peter Bengtsson wrote:
  If dtml-var ZopeTime fmt=Day but
  dtml-var foo fmt=Day doesn't then there's nothing wrong with how
  you're using the fmt parameter but something is wrong with foo.
  Try::
 
   dtml-var foo.strftime('Day')
 this gives the following error: 'str' object has no attribute strftime
 regards
 garry
 
 
  On 8/29/05, garry saddington [EMAIL PROTECTED] wrote:
   I am trying to format a dtml-var date by using fmt=Day
dtml-var foo fmt=Day returns error: Error Type: TypeError
   Error Value: not all arguments converted during string formatting
  
   while dtml-var ZopeTime fmt=Day works fine.
  
   The date is International format and I have Zope set up to parse
   international dates.
   Does anyone know where I am going wrong?
   regards
   garry
  
   ___
   Zope maillist  -  Zope@zope.org
   http://mail.zope.org/mailman/listinfo/zope
   **   No cross posts or HTML encoding!  **
   (Related lists -
http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )
  
 
 
 
 


-- 
Peter Bengtsson, 
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


RE: [Zope] date in Z Gadfly Database

2000-11-30 Thread Farrell, Troy

Note that Gadfly does not support the DATE datatype.  You can use VARCHAR to
store a string, or switch to a different database, such as PostgreSQL (my
personal preference) or MySQL.  The answer to your question is found here:

http://www.chordate.com/kwParsing/gadfly.html#table

The main Gadfly pages are here:

http://www.chordate.com/gadfly.html

Troy

 -Original Message-
From: Angietel [mailto:[EMAIL PROTECTED]]
Sent: Thursday, November 23, 2000 2:16 AM
To: [EMAIL PROTECTED]
Subject: [Zope] date in Z Gadfly Database


When i create a table, one of the fields is consider as date type, but the Z
Gadfly Database does not allow me to do that, it only accepts INTEGER
instead of DATE type.

The following is my SQL for creating a table:-

CREATE TABLE customer
(custid VARCHAR(10),
custname VARCHAR(15),
custactdate DATE,
custadd1 VARCHAR(30),
custadd2 VARCHAR(30))

 
Please let me know if i got an error.Thank You.

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Date

2000-11-22 Thread Tom Deprez

Hum, but then you also have to take into account the possible year change.
But a nice idea.

Tom.

At 23:17 21/11/2000 +0100, Dieter Maurer wrote:
Tom Deprez writes:
  Does someone knows how to calculate the date after 6 months of a
certain date?
  
  eg ZopeTime() + 6 months?
  
  Is there an easy formula for this? Or do I've to check myself for a new
  year, leap year
When I would need it (and did not find a better method),
I would use (in an external method):

  1. convert to a Python time tuple
  2. add 6 to the month component (creating a new tuple)
  3. convert back to a DateTime object.

It might be necessary to normalize the time tuple
before 3. with an "time.localtime(time.mktime(tup))".


Dieter



___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Date

2000-11-22 Thread Mario Olimpio de Menezes

On Wed, 22 Nov 2000, Tom Deprez wrote:

 Hum, but then you also have to take into account the possible year change.
 But a nice idea.
 
 Tom.
 
 At 23:17 21/11/2000 +0100, Dieter Maurer wrote:
 Tom Deprez writes:
   Does someone knows how to calculate the date after 6 months of a
 certain date?
   
   eg ZopeTime() + 6 months?
   
   Is there an easy formula for this? Or do I've to check myself for a new
   year, leap year
 When I would need it (and did not find a better method),
 I would use (in an external method):
 
   1. convert to a Python time tuple
   2. add 6 to the month component (creating a new tuple)
   3. convert back to a DateTime object.
 
 It might be necessary to normalize the time tuple
 before 3. with an "time.localtime(time.mktime(tup))".


it seems that DateTime has some functions to do addition and
subtraction; i'm not sure about the behaviour, but it can do:

aDateTime + other
  A DateTime may be added to a number and a number may be added to a
  DateTime; two DateTimes cannot be added

maybe you could do some tests to see the results with this
functions. see DateTime.html in /path/to/zope/lib/python/DateTime

as a guess: aDateTime + 6 x 30

[]s
Mario O.de Menezes"Many are the plans in a man's heart, but
IPEN-CNEN/SP is the Lord's purpose that prevails"
http://curiango.ipen.br/~mario Prov. 19.21


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Date

2000-11-22 Thread Dieter Maurer

Tom Deprez writes:
  Hum, but then you also have to take into account the possible year change.
  But a nice idea.
This is handled by the Python "mktime" and "localtime/gmtime".
You need not to worry about.



Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] Date

2000-11-21 Thread Eric Walstad

Here you go Tom.  I think this is what you are looking for.
There's probably a more streamlined way to implement it, but this seems to
work nicely.
Sorry for the VB-style variable names (grin)

Hope you find it useful.  -Eric.


Here's the (ONLY) DTML used to test the functions:
-8-8-8-
dtml-call expr="REQUEST.set('d', ZopeTime('1999/11/21'))"
Here's the result of dateInNMonths on November 21, 1999 + 6 months:br
dtml-var expr="dateInNMonths(this(),d, 6)"
br
-8-8-8-

I implemented it using two "Python Methods" as follows:
-8-8-8-
ID: daysPerMonth
Parameters: ZopeDateTime -- Pass in a Zope Date Time object
Function:
if ZopeDateTime.isLeapYear():
intDaysInFebruary = 29
else:
intDaysInFebruary = 28

strMonthName=ZopeDateTime.Month()

dicDaysPerMonth =
{'January':31,'February':intDaysInFebruary,'March':31,'April':30,'May':31,'J
une':30,'July':31,'August':31,'September':30,'October':31,'November':30,'Dec
ember':31}

return dicDaysPerMonth.get(strMonthName, 0)
-8-8-8-
ID: dateInNMonths
Parameters: self, ZopeDateTime, Months
Function:
days = self.daysPerMonth(ZopeDateTime) - ZopeDateTime.day() + 1

i = 2

while i  Months:
nextDate = ZopeDateTime + days
days = days + self.daysPerMonth(nextDate)
i = i + 1

days = days + ZopeDateTime.day() - 1

return ZopeDateTime + days
-8-8-8-

-Original Message-
From: Eric Walstad [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 21, 2000 10:19 AM
To: Tom Deprez
Subject: RE: [Zope] Date


Hi Again Tom,
OK, This is an interesting one that I may need later on.  I'll work on it
and get back to you...

-Original Message-
From: Tom Deprez [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, November 21, 2000 9:43 AM
To: [EMAIL PROTECTED]
Subject: RE: [Zope] Date


Thanks Eric,

Unfortunately, although I only need to know the month and the year, I need
to know the exact month. In certain circumstances the method below will
give me a wrong month.

Tom.

At 09:29 21/11/2000 -0800, Eric Walstad wrote:
Hi Tom,
I have a Python Method (or whatever they're called now) that uses the
following line
d = self.ZopeTime() + days
So, you could do something like:
d = self.ZopeTime() + (days * 30 * 6)
However, not all months are 30 days so this isn't totally accurate.  But,
maybe it's good enough for your needs.

Hope it helps,
Eric

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Tom
Deprez
Sent: Tuesday, November 21, 2000 8:38 AM
To: [EMAIL PROTECTED]
Subject: [Zope] Date


Does someone knows how to calculate the date after 6 months of a certain
date?

eg ZopeTime() + 6 months?

Is there an easy formula for this? Or do I've to check myself for a new
year, leap year

Tom.

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Date

2000-11-21 Thread Dieter Maurer

Tom Deprez writes:
  Does someone knows how to calculate the date after 6 months of a certain date?
  
  eg ZopeTime() + 6 months?
  
  Is there an easy formula for this? Or do I've to check myself for a new
  year, leap year
When I would need it (and did not find a better method),
I would use (in an external method):

  1. convert to a Python time tuple
  2. add 6 to the month component (creating a new tuple)
  3. convert back to a DateTime object.

It might be necessary to normalize the time tuple
before 3. with an "time.localtime(time.mktime(tup))".


Dieter


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] date off by one day per year cummulative

2000-10-22 Thread Chris McDonough

Jonathan,

Would you be kind enough to put this bug into the collector on Zope.org?

- Original Message -
From: "Jonathan Cheyne" [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, October 22, 2000 10:02 AM
Subject: [Zope] date off by one day per year cummulative



 Hi all, Zope 2.2.0, displaying a date property from a zclass has been out
 by one day for a while, trick was just to +1 to the dtml. THought this
 was fine til dates into 2001 needed to go on and hey, they become one
 day too far now ... so now I need to add code to determine the year before
 adding or not.

 Not good. Quite grim, actually.

 It only happens when you use the fmt="xyz" to reformat the dates into
 UK dd/mm/yy (from the default yy/mm/dd).

 Should I just work around for now, or is this likely to remain like this
 for a while. If so then zope gets mildly unusable outside the USA.

 cheers

 Jonathan



 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )




___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] date comparison

2000-10-14 Thread Dieter Maurer

michael angelo ruberto writes:
  i had tried something similar already without success. here is the error
  your script caused:
  ...
  Error Type: TypeError
  Error Value: unsubscriptable object
  
  for some reason Zope just doesn't want to compare ZopeTime with
  bobobase_modification_time.

"bobobase_modification_time" is a method (at least for folder), not a value.
Use "_['bobobase_modification_time']" instead.


Dieter

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




RE: [Zope] date comparison

2000-10-13 Thread michael angelo ruberto

hi,

i had tried something similar already without success. here is the error
your script caused:

DOH!


Zope Error
Zope has encountered an error while publishing this resource.

Error Type: TypeError
Error Value: unsubscriptable object

for some reason Zope just doesn't want to compare ZopeTime with
bobobase_modification_time. i started reading the readme i found for the
python DateTime method but it hasn't shed any light on the situation yet. i
will try doing it with javascript. i can write the modification dates of the
objects into arrays and do the comparisons using a scripting language that
works.

thanks

-mike-

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Kapil
Thangavelu
Sent: Wednesday, October 11, 2000 2:53 PM
To: michael angelo ruberto
Cc: [EMAIL PROTECTED]
Subject: Re: [Zope] date comparison


michael angelo ruberto wrote:

 i want to create an index page that displays whether or not a page has
been
 updated in the past 7 days or the past 20 days. however, i can't figure
out
 how to get the bobobase_modification_date to compare with ZopeTime. can
 someone give me a clue before i rush blindly down Zope's undocumented dark
 alleys.

 mike

untested

ul
dtml-in "objectValues['DTMLDocument']"
dtml-if "ZopeTime()-7  bobo_base_modifcation_time"
libNew/bdtml-var absolute_url/li
dtml-elif "ZopeTime()-20  bobo_base_modifcation_time"
libSomewhat New/bdtml-var absolute_url/li
dtml-else
libOld/bdtml-var absolute_url/li
/dtml-if
/dtml-in
/ul

kapil

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists -
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] date comparison

2000-10-11 Thread Kapil Thangavelu

michael angelo ruberto wrote:
 
 i want to create an index page that displays whether or not a page has been
 updated in the past 7 days or the past 20 days. however, i can't figure out
 how to get the bobobase_modification_date to compare with ZopeTime. can
 someone give me a clue before i rush blindly down Zope's undocumented dark
 alleys.
 
 mike

untested

ul
dtml-in "objectValues['DTMLDocument']"
dtml-if "ZopeTime()-7  bobo_base_modifcation_time"
libNew/bdtml-var absolute_url/li
dtml-elif "ZopeTime()-20  bobo_base_modifcation_time"
libSomewhat New/bdtml-var absolute_url/li
dtml-else
libOld/bdtml-var absolute_url/li
/dtml-if
/dtml-in
/ul

kapil

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Date format question urgent!!!

2000-07-27 Thread Marcel Preda

On Thu, 27 Jul 2000, Marko MARKOVIC wrote:

 hi all,
 
 i have a few questions about date formating:
 
I'll skip this, were a lot of threads about DateTime format (fmt)
Other time..

 
 
 Finally, i want formatting a date as 2000/01/01 and then put in my table with a sql 
method.
 
 Any suggestions or a good example will be apprecieated...
 

dtml-let tert="'01.01.1900'"
dtml-let myTime="ZopeTime(tert)"
dtml-let yourDate= "'%s/%s/%s' % (myTime.year(), myTime.mm(),
myTime.dd())"
do something here ...
/dtml-let
/dtml-let
/dtml-let


But
dtml-let yourDate= "'%s/%s/%s' %(tert[6:], tert[3:5],tert[:2])"

must be faster, if you have the date in the format:
dd.mm.
otherway ...


 
 
 $Regards
 
 MM
 

PM


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Date time format

2000-07-19 Thread Tony McDonald

At 5:46 pm +0800 19/7/00, [EMAIL PROTECTED] wrote:
Hi all,

Anyone know if there is any good tutorial for date time format ? Like
abstract the day or month or year in a ZopeTime string.

as if by magic

http://www.zope.org/Members/AlexR/CustomDateFormats

hth
tone
--
Dr Tony McDonald,  FMCC, Networked Learning Environments Project 
http://nle.ncl.ac.uk/
The Medical School, Newcastle University Tel: +44 191 222 5888
Fingerprint: 3450 876D FA41 B926 D3DD  F8C3 F2D0 C3B9 8B38 18A2

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Date time format

2000-07-19 Thread Chris Withers

[EMAIL PROTECTED] wrote:
 Anyone know if there is any good tutorial for date time format ? Like
 abstract the day or month or year in a ZopeTime string.

See the Zope Quick Reference or the DTML Reference

cheers,

Chris

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Date-bug in properties?

2000-07-10 Thread Peter Arvidsson

Ah I saw that was a known bug. Forget this post :)

Peter Arvidsson skrev:

 When I try to add a date-property and want to leave the Value-field
 empty i get the following error:

 Error Type: Invalid Date-Time String
 Error Value:

 When I write a date in the Value-field I can add the date. Is this a
 bug? Why cant I add a date with no default value? In several howtos they
 just add the date with no default value, so why cant I?

 ___
 Zope maillist  -  [EMAIL PROTECTED]
 http://lists.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://lists.zope.org/mailman/listinfo/zope-announce
  http://lists.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )