Davy Kelly

Ranch Hand
+ Follow
since Jan 12, 2004
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Davy Kelly

oops....

my problem was I was passing in the months as jan = 1 when it should be 0.

so I changed my script a wee bit, and took one away from the months

ik

edit:
this is my script now

I get the date of birth from a form...



[ January 16, 2008: Message edited by: Davy Kelly ]
[ January 16, 2008: Message edited by: Davy Kelly ]
hey everyone,

I am trying to get an age script to work.

but it keeps failing, or when I think its working right I try random dates and it fails.

what am I doing wrong.



i tried a few thing, namely:
changing the flow & operands if the statements
changing the decrement position in the statement.

nothing seems to get this correct.

I know that I am looking for:
if my birth month is less than or equal to this month AND
if my date of birth is equal to or less than today
then I am one year older

but it does not work

how can I sort this?

ik
Thanks Mike

You have covered all of my points very thoroughly, and I like the sound of it so far.

I like how you mentioned if you know HTML/CSS it takes you to guru level, I certainly hope so, as I feel I am still just competent.
I like the sound of fluid CSS that can deal with mobile phones.

I was very encouraged by the fact you prefer to learn from example, as I find this method works best for me, ok it might take a bit longer, but I do prefer to test things out, and see what is happening.

Thank you for your reply to my topics. I look forward to maybe one day owning this book, whether it be from this comp or buying it.

good luck in the future
please if you will a series of questions.

1: cross browser; does this book deal with this problem in detail? I have had a few problems in the past, but always worked round them.

2: would this book be a complete reference guide as to the two technologies, or is this just a book for getting started?

3: is there code to follow so that readers can produce accurate pages, as I find this helps?

4: does this book deal with backwards compatibilty in all senses, e.g. smaller screen sizes, older browsers, etc?

5: what about the new technologies like aural style sheets, does this book explain exactly what you need for aural web sites?

thanks, I think that sums up my questions about this book

davy
I think I finally got it.

My problem was not looking for both at the same time.

so here is my new improved code, whiter than white... hehe

hope its right, I tested by changing the comp clock from Feb 3 and Feb 4, it seems to work well.



davy
I have even tested this, and it does not work, it does not update properly.



davy

EDIT: I think I got this code to work well, so far:

EDIT: well tested again, and it still does not seem to update well. sometimes it does sometimes it does not, not sure what is going on.

Bearing in mind I am changing my computer clock to test this code out, and I refresh the page all the time.

[ August 02, 2007: Message edited by: Davy Kelly ]
[ August 02, 2007: Message edited by: Davy Kelly ]
well the birthday is set and that never changes.....

todays date always changes, but is dependent of the systems time....

I thought if I get the difference of both the millisecond and then get the full year out of that? problems is leap years....

davy
p.s. so its a case fo finding the difference between the days and months...

[ August 01, 2007: Message edited by: Davy Kelly ]
[ August 01, 2007: Message edited by: Davy Kelly ]
Ok I seen what I was kind of doing wrong,

I fixed a bit of it, I just cant get the year,



davy
[ August 01, 2007: Message edited by: Davy Kelly ]
nope still not with you

bear in mind, my brain has been on this all day.

also I am trying everything out all the time

davy
are you talking about putting in getYear instead of getFullYear?

davy
no matter what date in february in any year it does not move on to expected values.

so right now it should be 26, if I change comp clock to 3 feb 07, the age should be 25, it stays 26, no matter what date in feb

davy
hey all,

I want to calculate between 2 dates to display an age...

the date of birth is 4 Feb 1981, while taking that date away from today.

I tried this, and so far it kind of works.


as I said, this works for the most part, but when I change my computer clock to test this, if I am in February at all it does not update the age.

eg. I changed my comp clock to 3 Feb 2008, the age should be 26, but its 27, why is this?

what am I doing wrong?

davy
hey everyone,

I am still having problems with this.

I have a date as a String working in my program, but I want to change that String, in a different class, to an sql date so that I can store data to the database using this date.

this is my code so far which seems to go through the insert block all the time.



my database worked with column_1 set as varchar and I could store the date as a string, but i changed the database to a long date, which outputs on the database as 12 May 2007.
I am converting my String to an sql date which outputs as 2007-05-12.

could you help me out with this problem, so that I can store an sql date in MS Access so that my database can work?

davy
i tried this code:


I made my Access column_1 a long date, made it primary key.

I get an exception saying - "java.lang.ClassCastException: java.util.Date cannot be cast to java.sql.Date" here is the full stackTrace:


I checked the API, but I cant see what to do.
How can I fix this so that I can store a Date from the String?
I mainly want to change the string, cause I have taken 3 months on this, and dont want to go all over it and change the code for all the Strings to be dates.

davy
Hey everyone,

I have a working application that can write/update information to MS access.

I use Dates in my program, to show a booking sheets date. I use these as Strings right now, but I was wondering, if you could help me that is, what date should I set as one of my MS Access database fields, e.g:
General Date 19/06/1994 17:34:23
Long Date 19 June 1994
Medium Date 19-Jun-94
Short Date 19/06/1994
Also, I want to be able to make my String representation of a date, get turned to a date obeject, used in the database, then turned back to the String again. can this be done?
My format is a SimpleDateFormat Tuesday 08 May 2007.

Would I use the SimpleDateFormat to e.g.:


would this work?

or would this be better:


I have the date as my main working part of the database, as primary field, and I will ned to sort this in order later to get statistics, hence why I need to convert.

davy
[ May 08, 2007: Message edited by: Davy Kelly ]