<base href="x-msg://8415/">
I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it? _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
<base href="x-msg://8415/">
fd = SimpleDateFormat("E") /* day of the week */ dt = fd.format(Date()) adjust as necessary. From: [hidden email] [mailto:[hidden email]]
On Behalf Of Kenneth Klein (TEMA TPC) I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it? _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by kenner
You're probably better off using the Java java.util.Calendar and java.util.DateFormat classes. There are some examples in Rosetta Code too: http://rosettacode.org/wiki/Day_of_the_week#NetRexx
A. On 17 April 2013 10:41, Kenneth Klein (TEMA TPC) <[hidden email]> wrote:
Can't tweet, won't tweet! _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Alan
-- Needs more cowbell. |
In reply to this post by measel
<base href="x-msg://8415/">
Am I not importing the correct classes?: import java.util.Date import java.text.DateFormat class DateDemo public method main(args) static parm = string 'EEE' fd = SimpleDateFormat(parm) /* day of the week */ dt = fd.format(Date()) say dt C:\Users\KEKLEIN\REXX\NetRexx\bjcpe Wed 04/17/2013 15:59:56.93 > java -Dnrx.compiler=ecj org.netrexx.process.NetRexxC DateDemo.nrx
NetRexx portable processor, version NetRexx 3.02, build 11-20130323-1551 Copyright (c) RexxLA, 2011,2013. All rights reserved. Parts Copyright (c) IBM Corporation, 1995,2008. Program DateDemo.nrx === class DateDemo === function main(Rexx) 8 +++ fd = SimpleDateFormat(parm) /* day of the week */ +++ ^^^^^^^^^^^^^^^^ +++ Error: The method 'SimpleDateFormat(java.lang.String)' cannot be found in class 'DateDemo' or a superclass Compilation of 'DateDemo.nrx' failed [one error] From: [hidden email] [mailto:[hidden email]]
On Behalf Of Measel, Mike fd = SimpleDateFormat("E") /* day of the week */ dt = fd.format(Date()) adjust as necessary. From:
[hidden email] [[hidden email]]
On Behalf Of Kenneth Klein (TEMA TPC) I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it? _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
You need to import java.util.SimpleDateFormat. java.util.DateFormat is more flexible but requires more work on your part. SimpleDateFormat is simpler to use :-) You could overcome the issue by using:
import java.util. but it brings in way more than you normally need so it is preferable to be explicit but it comes at the cost of more typing. A. On 17 April 2013 13:07, Kenneth Klein (TEMA TPC) <[hidden email]> wrote:
Can't tweet, won't tweet! _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Alan
-- Needs more cowbell. |
In reply to this post by kenner
<base href="x-msg://8415/">
Hey Kenneth, in addition to the import that Alan mentioned, I think you are misunderstanding the call.
The “parm” value of “EEE” would be Wednesday,Wednesday, Wednesday. The parm you want to pass is to Date() if not today. The simpledateformat takes the argument
of how you want the output format. Parm = “4/16/2013” fd = SimpleDateFormat("E") /* day of the week */ dt = fd.format(Date(Parm)) say dt “Tuesday” From: [hidden email] [mailto:[hidden email]]
On Behalf Of Kenneth Klein (TEMA TPC) Am I not importing the correct classes?: import java.util.Date import java.text.DateFormat class DateDemo public method main(args) static parm = string 'EEE' fd = SimpleDateFormat(parm) /* day of the week */ dt = fd.format(Date()) say dt C:\Users\KEKLEIN\REXX\NetRexx\bjcpe Wed 04/17/2013 15:59:56.93 > java -Dnrx.compiler=ecj org.netrexx.process.NetRexxC DateDemo.nrx
NetRexx portable processor, version NetRexx 3.02, build 11-20130323-1551 Copyright (c) RexxLA, 2011,2013. All rights reserved. Parts Copyright (c) IBM Corporation, 1995,2008. Program DateDemo.nrx === class DateDemo === function main(Rexx) 8 +++ fd = SimpleDateFormat(parm) /* day of the week */ +++ ^^^^^^^^^^^^^^^^ +++ Error: The method 'SimpleDateFormat(java.lang.String)' cannot be found in class 'DateDemo' or a superclass Compilation of 'DateDemo.nrx' failed [one error] From: [hidden email] [mailto:[hidden email]]
On Behalf Of Measel, Mike fd = SimpleDateFormat("E") /* day of the week */ dt = fd.format(Date()) adjust as necessary. From:
[hidden email] [[hidden email]]
On Behalf Of Kenneth Klein (TEMA TPC) I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it? _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by alansam
This is finally what worked for me: import java.util.Date import java.text. import java.text.DateFormat import java.text.SimpleDateFormat class DateDemo public method main(s=String[]) static
Parm = '4/16/2013' fd = SimpleDateFormat("E") /* day of the week */ dt = fd.format(Date(Parm)) say dt From: [hidden email] [mailto:[hidden email]]
On Behalf Of Alan Sampson You need to import java.util.SimpleDateFormat. java.util.DateFormat is more flexible but requires more work on your part. SimpleDateFormat is simpler to use :-) You could overcome the issue by using: import java.util. but it brings in way more than you normally need so it is preferable to be explicit but it comes at the cost of more typing. A. On 17 April 2013 13:07, Kenneth Klein (TEMA TPC) <[hidden email]> wrote: Am I not importing the correct classes?: import java.util.Date import java.text.DateFormat class DateDemo public
method main(args) static
parm = string 'EEE' fd = SimpleDateFormat(parm) /* day of the week */ dt = fd.format(Date()) say dt C:\Users\KEKLEIN\REXX\NetRexx\bjcpe Wed 04/17/2013 15:59:56.93 > java -Dnrx.compiler=ecj org.netrexx.process.NetRexxC DateDemo.nrx
NetRexx portable processor, version NetRexx 3.02, build 11-20130323-1551 Copyright (c) RexxLA, 2011,2013. All rights reserved. Parts Copyright (c) IBM Corporation, 1995,2008. Program DateDemo.nrx === class DateDemo === function main(Rexx) 8 +++ fd = SimpleDateFormat(parm) /* day of the week */ +++ ^^^^^^^^^^^^^^^^ +++ Error: The method 'SimpleDateFormat(java.lang.String)' cannot be found in class 'DateDemo' or a superclass Compilation of 'DateDemo.nrx' failed [one error] From:
[hidden email] [mailto:[hidden email]]
On Behalf Of Measel, Mike fd = SimpleDateFormat("E") /* day of the week */ dt = fd.format(Date()) adjust as necessary. From:
[hidden email] [[hidden email]]
On Behalf Of Kenneth Klein (TEMA TPC) I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it?
-- _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
On 04/18/2013 12:33 PM, Kenneth Klein (TEMA TPC) wrote:
It's only marginally successful on my system:
But your _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by kenner
In each 400 day section of the Gregorian day number, each day number evenly divisible by 7 is a Sunday, as I remember. BOBH On Wed, Apr 17, 2013 at 12:41 PM, Kenneth Klein (TEMA TPC) <[hidden email]> wrote:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by kenner
On 04/17/13 13:41, Kenneth Klein (TEMA TPC) wrote:
> I want to use a date function to tell which day of the week a date is. Is this the best class to use and where can I find it? > > > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ > Ken, Yup... that's what I use. If the attachment is stripped contact me off list. _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ xmisc.nrx (17K) Download Attachment |
It didn't compile. It needs the xmath package too. I've come across this before. It appears that the NetRexx tutorial (http://www.netrexx.org/Tutorial/nr_1.html) has become disconnected from it's source code. A. On 18 April 2013 17:20, Jerry McBride <[hidden email]> wrote:
Can't tweet, won't tweet! _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/
Alan
-- Needs more cowbell. |
I added the xclasses.jar file to the tools page on netrexx.org.
The tutorial itself needs some work before I can link to it again. It looks very dated and sometimes sent people in the wrong direction. I hope someone can invest some time into it. best regards, René. On 19 apr. 2013, at 03:41, Alan Sampson <[hidden email]> wrote:
_______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ |
In reply to this post by alansam
So sorry. Here is the complete package in source.
On 04/18/13 21:41, Alan Sampson wrote: > It didn't compile. It needs the xmath package too. I've come across this > before. It appears that the NetRexx tutorial ( > http://www.netrexx.org/Tutorial/nr_1.html) has become disconnected from > it's source code. > > A. > > > On 18 April 2013 17:20, Jerry McBride <[hidden email]> wrote: > >> On 04/17/13 13:41, Kenneth Klein (TEMA TPC) wrote: >> >>> I want to use a date function to tell which day of the week a date is. Is >>> this the best class to use and where can I find it? >>> >>> >>> >>> ______________________________**_________________ >>> Ibm-netrexx mailing list >>> [hidden email] >>> Online Archive : http://ibm-netrexx.215625.n3.**nabble.com/<http://ibm-netrexx.215625.n3.nabble.com/> >>> >>> >> >> Ken, >> >> Yup... that's what I use. If the attachment is stripped contact me off >> list. >> >> >> >> _______________________________________________ >> Ibm-netrexx mailing list >> [hidden email] >> Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ >> >> >> > > > > > _______________________________________________ > Ibm-netrexx mailing list > [hidden email] > Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ > _______________________________________________ Ibm-netrexx mailing list [hidden email] Online Archive : http://ibm-netrexx.215625.n3.nabble.com/ pmatcht.nrx (1K) Download Attachment xarray.nrx (8K) Download Attachment xcmdline.nrx (4K) Download Attachment xconfig.nrx (3K) Download Attachment xdir.nrx (7K) Download Attachment xfile.nrx (13K) Download Attachment xftp.nrx (11K) Download Attachment xhistory.nrx (3K) Download Attachment xinfoline.nrx (1K) Download Attachment xinterpret.nrx (5K) Download Attachment xmath.nrx (8K) Download Attachment xmisc.nrx (17K) Download Attachment xpager.nrx (5K) Download Attachment xserv.nrx (5K) Download Attachment xsock.nrx (6K) Download Attachment xstring.nrx (11K) Download Attachment xsys.nrx (6K) Download Attachment xtimer.nrx (3K) Download Attachment xurl.nrx (13K) Download Attachment |
Free forum by Nabble | Edit this page |