Re: Does a day start at 1:00 AM everwhere?

2006-11-03 Thread Kay C Lan

On 10/28/06, Devin Asay <[EMAIL PROTECTED]> wrote:


I did this recently for my brother-in-law who is counting down the
days to retirement.


Or head off on a couples mission:-)
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Does a day start at 1:00 AM everwhere?

2006-10-28 Thread Marielle Lange



C:/RevolutionStacks/SortTest/!?!Sept_009K.jpg!/9040/1157431138


Ah, now I understand...

[...]
I really don't know, Mark... I would *assume* that the seconds is  
relative to the computer that is doing the extracting of the  
seconds from 'detailed files', but I have no conclusive proof...


What about ticks? Is it that seconds are converted into ticks or the  
other way around? I assume the other way around as ticks are shorter  
than seconds.


Citing the docs: "The ticks function returns the total number of  
ticks since midnight GMT, January 1, 1970, rather than the total  
number of ticks since the last system startup."


--
Marielle Lange (PhD),  http://widged.com
Bite-size Applications for Education





___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Does a day start at 1:00 AM everwhere?

2006-10-27 Thread Devin Asay


On Oct 27, 2006, at 9:20 AM, Marian Petrides wrote:

While we are on the topic of dates, I've been thinking about  
creating a "countdown" calendar, clocking the number of days  
remaining between today's date and some future date (March 31,  
20010 specifically).  Any tips on how I can do this?  Do I have to  
convert dates into seconds in order to subtract one from the other?


I did this recently for my brother-in-law who is counting down the  
days to retirement.


Check out:

go stack URL "http://asay.byu.edu/retire.rev";

Double click on the date at the bottom of the card to change it.  
Simple, but it seems to work.


Devin

Devin Asay
Humanities Technology and Research Support Center
Brigham Young University

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Does a day start at 1:00 AM everwhere?

2006-10-27 Thread Ken Ray
On 10/27/06 10:39 AM, "Mark Powell" <[EMAIL PROTECTED]> wrote:

> My problem is that I have two inputs.  One is the user inputting a date.
> Another is the creation date in seconds that has previously been
> extracted via a 'detailed files' call, which has been concatenated in
> the format below.
> 
> C:/RevolutionStacks/SortTest/!?!Sept_009K.jpg!/9040/1157431138

Ah, now I understand...
 
> What I wanted to do is to express the input date in seconds and test it
> against item -1 of each line in the container (there are potentially >
> 100,000 such lines in a container). Using dateItems or 'word 1 of
> tFileDateTime' as you suggest would require modification to the original
> 'detailed files' extraction algorithm, which doubtless will have a
> ripple effect elsewhere.  So, is there not any reliable way to compare
> seconds to seconds?  Or do I have to go the route of approximation.
> 
> Also Ken, the DST et. al. wrinkles you describe:  does that affect the
> interpretation of a creation date extracted from the file?  Or is the
> complication confined to how a particular user's computer calculates a
> time query?  For example, if a user's OS displays a creation date for
> "foo.txt" as 11/21/05, will Rev not always interpret it as 11/21/05?  Or
> can fencepost error arise where Rev misinterprets the static date?

I really don't know, Mark... I would *assume* that the seconds is relative
to the computer that is doing the extracting of the seconds from 'detailed
files', but I have no conclusive proof...

It seems like you may have to approximate unless someone else can provide
another solution.

Ken Ray
Sons of Thunder Software, Inc.
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Does a day start at 1:00 AM everwhere?

2006-10-27 Thread Dar Scott


On Oct 27, 2006, at 6:52 AM, Mark Powell wrote:


At 6:42 this
morning, I ran this:

  put the short date into theDate
  convert theDate to seconds
  put ((the seconds - theDate) / 3600)

and got 4.710556, which suggests that a date starts at 1:00 AM and not
midnight.  Is this accurate?  And more importantly, is this the way  
the

computation would be handled on any client machine anywhere?


The Rev conversions are wrong.

Given any time zone and given any criteria for a new day, that time  
in seconds that just barely makes the seconds to short date  
conversion tick over to a new date should be just over what you get  
when you convert the new date to seconds.  That is not the case.  It  
is off by an hour.


I think seconds-to-date is right (and probably 'the short date') and  
the problem is in date-to-seconds.


Here is the script I used for my time-zone (-0700):


on mouseUp
  put 7 * 3600 + 5 into s
  get s
  convert it to short date
  put it into d
  convert it to seconds
  put d && s && it && (s-it)/3600 & lf

  put 7 * 3600 - 5 into s
  get s
  convert it to short date
  put it into d
  convert it to seconds
  put d && s && it && (s-it)/3600 & lf after msg
end mouseUp
*
==>
1/1/70 25205 28800 -0.998611
12/31/69 25195 -57600 22.998611

The last column should be 0.014 and 23.998

As you can see 7 hours and 5 seconds is one date and 7 hours less 5  
seconds is another just before.  Converting the first date to seconds  
should get a value just under the seconds.  It does not.


Dar



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Does a day start at 1:00 AM everwhere?

2006-10-27 Thread SimPLsol
Mark,
If you are using OS X you'll find that the day going onto daylight savings 
time has 25 hours worth of seconds; and the day coming off DST has 23 hours 
worth of seconds.
It is safer and easier to use dateItems (add 1 to item 3 of the dateItems).
Paul Looney
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


RE: Does a day start at 1:00 AM everwhere?

2006-10-27 Thread Mark Powell
Jim and Ken:

Aargh. I hate it when something I'd hope would be easy turns into a
rathole. 

My problem is that I have two inputs.  One is the user inputting a date.
Another is the creation date in seconds that has previously been
extracted via a 'detailed files' call, which has been concatenated in
the format below.   

C:/RevolutionStacks/SortTest/!?!Sept_009K.jpg!/9040/1157431138

What I wanted to do is to express the input date in seconds and test it
against item -1 of each line in the container (there are potentially >
100,000 such lines in a container). Using dateItems or 'word 1 of
tFileDateTime' as you suggest would require modification to the original
'detailed files' extraction algorithm, which doubtless will have a
ripple effect elsewhere.  So, is there not any reliable way to compare
seconds to seconds?  Or do I have to go the route of approximation.

Also Ken, the DST et. al. wrinkles you describe:  does that affect the
interpretation of a creation date extracted from the file?  Or is the
complication confined to how a particular user's computer calculates a
time query?  For example, if a user's OS displays a creation date for
"foo.txt" as 11/21/05, will Rev not always interpret it as 11/21/05?  Or
can fencepost error arise where Rev misinterprets the static date?

Thanks again

Mark Powell
 

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Mark
Powell
Sent: Friday, October 27, 2006 6:53 AM
To: use-revolution@lists.runrev.com
Subject: Does a day start at 1:00 AM everwhere?

I have a user-specified date.  I want to convert it to seconds and
factor in 86400 to establish the range of seconds for that date, so that
I can compare a file's creation date to determine whether that file was
created on that specified day.  The problem is I am not sure what is
used as the starting point for a date's seconds counter.  At 6:42 this
morning, I ran this:

  put the short date into theDate
  convert theDate to seconds
  put ((the seconds - theDate) / 3600)

and got 4.710556, which suggests that a date starts at 1:00 AM and not
midnight.  Is this accurate?  And more importantly, is this the way the
computation would be handled on any client machine anywhere?

Thanks

Mark Powell

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your
subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Does a day start at 1:00 AM everwhere?

2006-10-27 Thread Marian Petrides

make that 2010  not 20010 :-)
On Oct 27, 2006, at 10:20 AM, Marian Petrides wrote:

While we are on the topic of dates, I've been thinking about  
creating a "countdown" calendar, clocking the number of days  
remaining between today's date and some future date (March 31,  
20010 specifically).  Any tips on how I can do this?  Do I have to  
convert dates into seconds in order to subtract one from the  
other?  Thanks.


On Oct 27, 2006, at 9:49 AM, Ken Ray wrote:


On 10/27/06 7:52 AM, "Mark Powell" <[EMAIL PROTECTED]> wrote:


I have a user-specified date.  I want to convert it to seconds and
factor in 86400 to establish the range of seconds for that date,  
so that
I can compare a file's creation date to determine whether that  
file was

created on that specified day.  The problem is I am not sure what is
used as the starting point for a date's seconds counter.  At 6:42  
this

morning, I ran this:

  put the short date into theDate
  convert theDate to seconds
  put ((the seconds - theDate) / 3600)

and got 4.710556, which suggests that a date starts at 1:00 AM  
and not
midnight.  Is this accurate?  And more importantly, is this the  
way the

computation would be handled on any client machine anywhere?


Welcome to the wonderful world of dates in Revolution!

;-)

Seriously - Many of us have struggled with date arithmetic in Rev  
as it
relates to other parts of the world. The short answer is "no", it  
is not
always 1:00 AM everywhere when you convert a date to seconds and  
back again.

In fact for me, I get 2:00 AM.

Date conversions give you different results depending on a number of
factors: is Daylight Saving Time (DST) or Summer Hours currently  
being
observed? What hemisphere are you on? Are you looking at a date  
that is
"across" a DST boundary (such as the current date being in March  
and you're
looking at a date in May, which is across the DST "boundary" in  
April).


I wish it were easier, but it's not... in your *specific*  
application,
though, if you're just trying to compare one date to another, you  
can strip
off the time from the file creation date, and then convert the  
user-entered
date and the date from the file creation to seconds and compare -  
they

should be the same:

  put fld "UserDate" into tUserDate
  put fld "FileCreationDateTime" into tFileDateTime
  put word 1 of tFileDateTime into tFileDate
   -- assumes a datetime where the date and time are separate by a  
space

  convert tUserDate to seconds
  convert tFileDate to seconds
  if tUserDate = tFileDate then
answer "Same day"
  else
answer "Different day"
  end if

Will this work for you?

Ken Ray
Sons of Thunder Software, Inc.
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Does a day start at 1:00 AM everwhere?

2006-10-27 Thread Marian Petrides
While we are on the topic of dates, I've been thinking about creating  
a "countdown" calendar, clocking the number of days remaining between  
today's date and some future date (March 31, 20010 specifically).   
Any tips on how I can do this?  Do I have to convert dates into  
seconds in order to subtract one from the other?  Thanks.


On Oct 27, 2006, at 9:49 AM, Ken Ray wrote:


On 10/27/06 7:52 AM, "Mark Powell" <[EMAIL PROTECTED]> wrote:


I have a user-specified date.  I want to convert it to seconds and
factor in 86400 to establish the range of seconds for that date,  
so that
I can compare a file's creation date to determine whether that  
file was

created on that specified day.  The problem is I am not sure what is
used as the starting point for a date's seconds counter.  At 6:42  
this

morning, I ran this:

  put the short date into theDate
  convert theDate to seconds
  put ((the seconds - theDate) / 3600)

and got 4.710556, which suggests that a date starts at 1:00 AM and  
not
midnight.  Is this accurate?  And more importantly, is this the  
way the

computation would be handled on any client machine anywhere?


Welcome to the wonderful world of dates in Revolution!

;-)

Seriously - Many of us have struggled with date arithmetic in Rev  
as it
relates to other parts of the world. The short answer is "no", it  
is not
always 1:00 AM everywhere when you convert a date to seconds and  
back again.

In fact for me, I get 2:00 AM.

Date conversions give you different results depending on a number of
factors: is Daylight Saving Time (DST) or Summer Hours currently being
observed? What hemisphere are you on? Are you looking at a date  
that is
"across" a DST boundary (such as the current date being in March  
and you're
looking at a date in May, which is across the DST "boundary" in  
April).


I wish it were easier, but it's not... in your *specific* application,
though, if you're just trying to compare one date to another, you  
can strip
off the time from the file creation date, and then convert the user- 
entered

date and the date from the file creation to seconds and compare - they
should be the same:

  put fld "UserDate" into tUserDate
  put fld "FileCreationDateTime" into tFileDateTime
  put word 1 of tFileDateTime into tFileDate
   -- assumes a datetime where the date and time are separate by a  
space

  convert tUserDate to seconds
  convert tFileDate to seconds
  if tUserDate = tFileDate then
answer "Same day"
  else
answer "Different day"
  end if

Will this work for you?

Ken Ray
Sons of Thunder Software, Inc.
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your  
subscription preferences:

http://lists.runrev.com/mailman/listinfo/use-revolution


___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Does a day start at 1:00 AM everwhere?

2006-10-27 Thread Ken Ray
On 10/27/06 7:52 AM, "Mark Powell" <[EMAIL PROTECTED]> wrote:

> I have a user-specified date.  I want to convert it to seconds and
> factor in 86400 to establish the range of seconds for that date, so that
> I can compare a file's creation date to determine whether that file was
> created on that specified day.  The problem is I am not sure what is
> used as the starting point for a date's seconds counter.  At 6:42 this
> morning, I ran this:
> 
>   put the short date into theDate
>   convert theDate to seconds
>   put ((the seconds - theDate) / 3600)
> 
> and got 4.710556, which suggests that a date starts at 1:00 AM and not
> midnight.  Is this accurate?  And more importantly, is this the way the
> computation would be handled on any client machine anywhere?

Welcome to the wonderful world of dates in Revolution!

;-)

Seriously - Many of us have struggled with date arithmetic in Rev as it
relates to other parts of the world. The short answer is "no", it is not
always 1:00 AM everywhere when you convert a date to seconds and back again.
In fact for me, I get 2:00 AM.

Date conversions give you different results depending on a number of
factors: is Daylight Saving Time (DST) or Summer Hours currently being
observed? What hemisphere are you on? Are you looking at a date that is
"across" a DST boundary (such as the current date being in March and you're
looking at a date in May, which is across the DST "boundary" in April).

I wish it were easier, but it's not... in your *specific* application,
though, if you're just trying to compare one date to another, you can strip
off the time from the file creation date, and then convert the user-entered
date and the date from the file creation to seconds and compare - they
should be the same:

  put fld "UserDate" into tUserDate
  put fld "FileCreationDateTime" into tFileDateTime
  put word 1 of tFileDateTime into tFileDate
   -- assumes a datetime where the date and time are separate by a space
  convert tUserDate to seconds
  convert tFileDate to seconds
  if tUserDate = tFileDate then
answer "Same day"
  else
answer "Different day"
  end if

Will this work for you?

Ken Ray
Sons of Thunder Software, Inc.
Web site: http://www.sonsothunder.com/
Email: [EMAIL PROTECTED]

___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: Does a day start at 1:00 AM everwhere?

2006-10-27 Thread Jim Ault
On 10/27/06 5:52 AM, "Mark Powell" <[EMAIL PROTECTED]> wrote:

> I have a user-specified date.  I want to convert it to seconds and
> factor in 86400 to establish the range of seconds for that date, so that
> I can compare a file's creation date to determine whether that file was
> created on that specified day.  The problem is I am not sure what is
> used as the starting point for a date's seconds counter.  At 6:42 this
> morning, I ran this:
> 
>   put the short date into theDate
>   convert theDate to seconds
>   put ((the seconds - theDate) / 3600)
> 
> and got 4.710556, which suggests that a date starts at 1:00 AM and not
> midnight.  Is this accurate?  And more importantly, is this the way the
> computation would be handled on any client machine anywhere?
> 
Try this.

put the short date into theDate
convert theDate to dateItems
put dateItems

I get 2006,10,27,2,0,0,6
which means 2:00:00 AM on Saturday, Oct 27, 2006


Jim Ault
Las Vegas



___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution