Is this ok to get write a time (J.S.); why not use this instead of ... | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

Is this ok to get write a time (J.S.); why not use this instead of ...

Why not use ___(my code) instead of: Function fun(){ var d = new Date(); var hour = d.getHours() var min = ....... Instead of listing it like that ^ , why not just do it like this... is there any problem with it - ? https://code.sololearn.com/WQXFOrRsBoNu/?ref=app

16th Jun 2019, 11:54 PM
Ginfio
Ginfio - avatar
2 Answers
+ 2
You can do it your way if you want local time. But you can do the other way if you only want to return hours or minutes.
17th Jun 2019, 12:07 AM
Chris Coder
Chris Coder - avatar
+ 1
got it ✔️
17th Jun 2019, 12:08 AM
Ginfio
Ginfio - avatar