Page 1 of 1 1
Topic Options
#189731 - 2008-09-18 04:10 PM Previous Day Script
gdalinis Offline
Fresh Scripter

Registered: 1999-12-07
Posts: 27
Hi All,

Was wondering if anyone had sample code that figures out the previous day and also knows if it is the 1st of the month, the previous day rolls back a month and knows the last calendar day of the previous month?

Thanks!

Gus

Top
#189732 - 2008-09-18 04:40 PM Re: Previous Day Script [Re: gdalinis]
Mart Moderator Offline
KiX Supporter
*****

Registered: 2002-03-27
Posts: 4672
Loc: The Netherlands
I think there are some UDF's in the UDF section that are able to do (almost) waht you want. Have a look in the UDF section.
_________________________
Mart

- Chuck Norris once sold ebay to ebay on ebay.

Top
#189733 - 2008-09-18 07:25 PM Re: Previous Day Script [Re: Mart]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
I use SerialDate, found in the UDF section, for all things like this.
http://www.kixtart.org/forums/ubbthreads...=true#Post82573

for example
 Code:
$yesterday=serialdate(serialdate(@date)-1)
? $yesterday


or to break it down
 Code:
? @date
$today=serialdate(@date)
? $today
$yesterday=serialdate(@date)-1
? $yesterday
$yesterday=serialdate($yesterday)
? $yesterday

Top
#189736 - 2008-09-18 08:11 PM Re: Previous Day Script [Re: Allen]
gdalinis Offline
Fresh Scripter

Registered: 1999-12-07
Posts: 27
OK ... call me a Noob ... but I have no idea what a UDF is. I am not a programmer but I do know kix as far as using all the stuff in the documentation.

When I try to use the code example:

$yesterday=serialdate(serialdate(@date)-1)

I get the following error:
ERROR : expected ')'!

Thanks for the help.
_________________________
Gus Dalinis Systems Analyst

Top
#189737 - 2008-09-18 08:13 PM Re: Previous Day Script [Re: gdalinis]
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4545
Loc: USA
Okay... Mr. Noob ;\)

Follow the link provided above. Copy the function to the bottom of your script. Use the example provided above... whala!

Top
#189748 - 2008-09-19 08:59 AM Re: Previous Day Script [Re: gdalinis]
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
 Originally Posted By: gdalinis
OK ... call me a Noob ... but I have no idea what a UDF is. I am not a programmer but I do know kix as far as using all the stuff in the documentation.


"Noob" is not so good, I prefer "Gus Dalinis Systems Analyst" - it sounds like a cracking daytime TV show about a forensic computer scientist who solves cases that defeat the local law enforcement.

Back from the plot... UDFs are described in the documentation and there is also a little more detail to be found in the FAQ forum: http://www.kixtart.org/forums/ubbthreads.php?ubb=showflat&Number=81943

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 329 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.064 seconds in which 0.026 seconds were spent on a total of 13 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org