Java Programming Tutorial - 37 - Display Regular time
Top Comments
All Comments (246)
-
Yeah, doesn't it just bother you when people living in a particular country have a world perspective associated with that country? It's almost like their environment plays a role in their growing understanding of the world around them!
You know what I am tired of? Bigots like you who jump at any opportunity to bash on somebody for holding a different world perspective than your own. So thenewboston considers strange what you consider normal? Get the fuck over it.
-
Ayo04Soul: facepalm
-
@Ayo04Soul so you downloaded eclipse and extracted it to a place on your computer? then ran it from its .exe file? oh and you might wanna go download java again.
-
I've got to lesson 37 and so far no problem with the programming. However, I wasn't able to successfully set up the Java environment or get Eclipse. working :-(.
So can you help with this.
I'm working with a Notebook (easy to carry around), running Microsoft windows XP home edition. I have previously downloaded Jre 1.5.0.
I tried the steps you mentioned but nothing ?
Anyway I will continue with the lessons (audio only) but would like to start practicing asap.
PS - I am an ex programmer
-
Haven't seen any challenges under the tuts for a while so here's one:
rebuild the clock so it asks the user what the time is then outputs that IN FORMAT :)
-
what was that at 0:06 youtube time
-
@soldado1997 are you 12 yrs of age ?
-
there are some problem bucky
if it take a modulus of hour than u have to change minute also
-
I think when you define your setTime() method, you should plan ahead to include larger numbers. So if they enter 25 hours, have it wrap around to hour 1 rather than defaulting to 0. I did that like this:
hours = h%24;
minutes = m%60;
seconds = s%60;
You could also wrap the entire thing in an if-statement checking that the values are positive (or write a conditional for each, but one if might be more efficient), negative time doesn't really make sense.
-
the views went down by 20,000. they are noobs
-
@soldado1997 Never back down, we're gonna be great after this playlist! Hang-on with Bucky!
-
@princekhurana14 12 goes into 5 0 times hence the remainder is 5.
Maybe that is not clear. 5 divided by 12 = 0 with remainder 5.
-
Analog (Not Literally) and Digital
-
"time@190d11" ?
-
I finally got it but missing am and pm dk where I went wrong that I cant get that
-
'{ ' shouldnt be just after function name, it makes the code look worse
just like in c++,
function (method) -> next line, bracket
-
Some one please tell me how did we get 5 % 12 as an answer =5 ???
-
i only get 00:00:00
12:00:00
00:00:00
12:00:00
-
@rob2701full you did the printing wrong
You must for printing am or pm &s not $s
-
when i run this
return String.format("%d:%02d:%02d $s", ((hour==0||hour==12)?12:hour%1
2), minute, second, (hour < 12? "AM" : "PM")); all i get is 00:00:00
or
12:00:00 $s can help?
-
My dear Bucky, you may be a fantastic teacher, but your idea of what regular time is is quite wrong.
-
Lol Bucky forgets a parenthesis, I forget a parenthesis :p
-
@karolyipeti Same thing here (Switzerland). I just called the methods "toStandard" and "toAmerican". I just hope the next program won't be about feet and miles...
-
you are finding the remainder of those variables and then printing them out
*me at class 1* "this is gonna be awesome! :D"
*me at class 37* "my head hurts, i hate this shit, i need an aspirin, but i won't give up!" xD
soldado1997 5 months ago 103
I called the variable for this "toWeirdAmerican". AM, PM, impossibly cluttered way of counting time imo.
On Earth the 'normal' way to keep track of time is what americans call "military".
Dystisis 3 months ago 42