Re: calendar function anyone ?

2007-02-14 Thread jbv
Hi all,

Thanks for your reply. Converting the date to dateItems actually crossed
my mind, but are you sure the convert function is 100% bug free ?
AFAIR, last time I used it in a cgi script, there was a 60 min difference
in some conversions (unfortunately I don't remember in which cases, but
I remember that this bug lead to a few threads on this list) and finally choosed
to make all date conversions with mySQL instead...

Best,
JB

  Does anyone know of a function to find out, for instance, which day of
  the
  week was sept. 18th 1918 or which day of week will be dec. 5th 2025 ?
 

 If you convert a date to dateItems, it becomes a comma-delimited list
 of 7 items. The last one is a number indicating the day of the week.
 Then you can use the system weekDayNames to find the day name that
 matches that number.

 e.g.
 put 12/5/2025 into tDate
 convert tDate to dateItems
 put the last item of tDate into tDayNum
 put line tDayNum of the system weekdayNames into tDayName

 Cheers,
 Sarah

___
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: calendar function anyone ?

2007-02-14 Thread hibis . jmr

I also notice a difference of 60 min only at a few dates (Mac OS X).
I have found that it happens when changing from winter date to summer 
date (in France)

The foreign system dates seems not to be well managed by revolution
Jean-Marc

Le 14 févr. 2007, à 11:43, jbv a écrit :


Hi all,

Thanks for your reply. Converting the date to dateItems actually 
crossed

my mind, but are you sure the convert function is 100% bug free ?
AFAIR, last time I used it in a cgi script, there was a 60 min 
difference

in some conversions (unfortunately I don't remember in which cases, but
I remember that this bug lead to a few threads on this list) and 
finally choosed

to make all date conversions with mySQL instead...

Best,
JB

Does anyone know of a function to find out, for instance, which day 
of

the
week was sept. 18th 1918 or which day of week will be dec. 5th 2025 ?



If you convert a date to dateItems, it becomes a comma-delimited list
of 7 items. The last one is a number indicating the day of the week.
Then you can use the system weekDayNames to find the day name that
matches that number.

e.g.
put 12/5/2025 into tDate
convert tDate to dateItems
put the last item of tDate into tDayNum
put line tDayNum of the system weekdayNames into tDayName

Cheers,
Sarah


___
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: calendar function anyone ?

2007-02-14 Thread Sarah Reichelt

When you are working with dates only, the dateItems will usually show
the hour as 2 am, but sometimes as 1 am depending on daylight savings.
To avoid any potential cross-overs, when working with dates alone, I
tend to supply a default time of midday. The convert command will not
mess this up by supplying it's own default and since it is in the
middle of the day, I know the date will be correct.

Re-writing my suggested function allowing for this:

function weekDay pDate
 put pDate  12:00 pm into tDate
 convert tDate to dateItems
 put the last item of tDate into tDayNum
 put line tDayNum of the system weekdayNames into tDayName
 return tDayName
end weekDay

I think you will find this completely reliable.

As an aside on the convert command: I have issues with the way convert
automatically applies the current time zone when converting seconds so
that a specific number of seconds refers to a moment in time and not
to a set date  time. This makes the seconds useless to me as a data
storage  transfer device since the conversions will vary from machine
to machine depending on time zones etc. I now store all time stamps in
a 14 digit number MMDDHHMMSS. However once I have this data, date
 time calculations can be done locally with the convert command only
being used to produce temporary variables, not long-term data storage.

Cheers,
Sarah




Thanks for your reply. Converting the date to dateItems actually crossed
my mind, but are you sure the convert function is 100% bug free ?
AFAIR, last time I used it in a cgi script, there was a 60 min difference
in some conversions (unfortunately I don't remember in which cases, but
I remember that this bug lead to a few threads on this list) and finally choosed
to make all date conversions with mySQL instead...

Best,
JB

  Does anyone know of a function to find out, for instance, which day of
  the
  week was sept. 18th 1918 or which day of week will be dec. 5th 2025 ?
 

 If you convert a date to dateItems, it becomes a comma-delimited list
 of 7 items. The last one is a number indicating the day of the week.
 Then you can use the system weekDayNames to find the day name that
 matches that number.

 e.g.
 put 12/5/2025 into tDate
 convert tDate to dateItems
 put the last item of tDate into tDayNum
 put line tDayNum of the system weekdayNames into tDayName

 Cheers,
 Sarah

___
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


calendar function anyone ?

2007-02-13 Thread jbv
Hi all,

Does anyone know of a function to find out, for instance, which day of
the
week was sept. 18th 1918 or which day of week will be dec. 5th 2025 ?

Thanks,
JB

___
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: calendar function anyone ?

2007-02-13 Thread Gordon Tillman

JB you can try something like this... for example, in the message box:

convert 1918,9,18,0,0,0,0 from dateItems to dateItems
put it

This returns:

1918,9,18,1,0,0,4

Note how it fixes the day of the week in the date items to 4  
(Wednesday)


Alternatively you can specify the output as something like this:

convert 1918,9,18,0,0,0,0 from dateItems to long date
put it

This returns:

Wednesday, September 18, 1918

But be sure and read the note for convert because I think there are  
some limitations if you are running on Windows.


--gordy


On Feb 13, 2007, at 14:44, jbv wrote:


Hi all,

Does anyone know of a function to find out, for instance, which day of
the
week was sept. 18th 1918 or which day of week will be dec. 5th 2025 ?

Thanks,
JB

___
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: calendar function anyone ?

2007-02-13 Thread Sarah Reichelt

Does anyone know of a function to find out, for instance, which day of
the
week was sept. 18th 1918 or which day of week will be dec. 5th 2025 ?



If you convert a date to dateItems, it becomes a comma-delimited list
of 7 items. The last one is a number indicating the day of the week.
Then you can use the system weekDayNames to find the day name that
matches that number.

e.g.
put 12/5/2025 into tDate
convert tDate to dateItems
put the last item of tDate into tDayNum
put line tDayNum of the system weekdayNames into tDayName

Cheers,
Sarah
___
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: calendar function anyone ?

2007-02-13 Thread Richard Gaskin

jbv wrote:

Does anyone know of a function to find out, for instance, which day of
the week was sept. 18th 1918 or which day of week will be dec. 5th 2025 ?


function GetWeekday pDate
  set the centurycutoff to (char -2 to -1 of pDate)-1
  convert pDate to dateitems
  return line (last item of pDate) of the weekdayNames
end GetWeekday


To get the day in the user's local language change the last line to:

  return line (last item of pDate) of the system weekdayNames


--
 Richard Gaskin
 Managing Editor, revJournal
 ___
 Rev tips, tutorials and more: http://www.revJournal.com
___
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: calendar function anyone ?

2007-02-13 Thread Chipp Walters

the weekdayNames ??

Good one, have to remember that :-)
___
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