Anyway, I want to point out straight off that my program probably wouldn't work as is with the computers own date. The reason for this is that the program (as I wrote in the original post on the sleep calculator) uses short years and months. You will lose 5 days in a normal year (6 in a leap year), lose 1 day for seven months each year and gain 2 days for one month (except in a leap year when you only gain 1 day for that month). No, to make this workable, a whole new equation will need to be worked out.
Having said all of that, I did some digging and found that you can use the Now() function to use the computers date. I get the distinct impression that this function is for older versions of VB. I can tell you that in Visual Studio, it comes up black.
A reader by the name of Jack posted this comment:
My.Computer.Clock.LocalTime.Yearwhich would make sense (however, it was posted on April 1st local time...), but you would still need to store the result in a variable obviously.
this is the code that shows the year from your computer system, and you can try the month and the day as the same.
I also found a pretty cool site called Top54u that showed how to display the date in various formats once you've captured it. I'd love to look into this further and redevelop the "rather silly sleep calculator" into an awesome and actually usable sleep calculator. I have the next two weeks off class, so I might give that a shot during the "break" (a term used very loosely as I have HEAPS of work to catch up on in the time).
Anyway, I hope there has been some helpful stuff in here and thanks to everyone who has been reading and keep the comments coming.
All the best,
Tim.
No comments:
Post a Comment