Assignment | Sololearn: Learn to code for FREE!



If we want assign a timing value in other variable (hour) so how can we assign this value?

9/27/2016 6:07:24 PM

sabreen anjum

5 Answers

New Answer


If you are trying to assign a value to see the hour you can do this a few ways. One use a scanner and have the user input a value directly or get the current time in milliseconds store that value in hour and do the conversion because saying int hour = %tr hour is a variable and needs to be equal to another variable. %tr is not a method for storage but for strings. Date is also of its own type and can not simply be turned into hour.


Can you rephrase the question? I'm not sure if you are asking how to assign a variable to a method or value to a variable? Some clarification will help

0 I got an error in this program please help to solve this.



Could you please tell me how to show this program time according to location (country's time)?