ok fellow cf'ers ... I have run into an interesting paradigm while trying to
operate with
negative time.

The story is as follows ... I'm adding another feature to my already
existing calendar application that allows for the admin to define "Start of
Day" and "End of Day", and as i was doing that, i realized that i could run
into situations where an already created appointment would start before
"Start of Day" but actually end after "Start of day". Now the code to solve
a problem like that isn't hard at all .... but i stumbled on something that
might be an error in the DateDiff function in ColdFusion.

The problems arises when i try to find the difference between the start of
my appoint and "Start of Day" ... In my case that means my "Start of day" is
later than the start of an appointment and therefore i knew that i should be
getting a negative value that i had to subtract from the duration of my
appointment in order for it to render properly on screen.

This is just an example but try to run it ....

#datediff("n", timeformat(application.startofday, "H:mm"), timeformat(start,
"H:mm"))#

or for example

#datediff("h", timeformat("6.00 AM", "H:mm"), timeformat("5.00 AM",
"H:mm"))#

the above example should return -60 but it doesn't ....


Now i'm not looking for a solution.... just another perspective on this
issue!


Allan Pichler
Machine Dreams Inc.



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to