hi i want to get current time and date in integer values plz help me
fnx alot
how to get current timehow to get current time and get d values hh/mm/ss in different intege
Page 1 of 1
8 Replies - 22805 Views - Last Post: 03 July 2008 - 04:19 AM
Replies To: how to get current time
#2
Re: how to get current time
Posted 02 July 2008 - 05:46 AM
I think you have to create a new DateTime object and get its Now field.
DateTime myTime = new DateTime(); int hh = myTime.Now.hh; int mm = myTime.Now.mm; int ss = myTime.Now.ss;
#3
Re: how to get current time
Posted 02 July 2008 - 05:51 AM
3DrunkPandas, on 2 Jul, 2008 - 05:46 AM, said:
I think you have to create a new DateTime object and get its Now field.
DateTime myTime = new DateTime(); int hh = myTime.Now.hh; int mm = myTime.Now.mm; int ss = myTime.Now.ss;
do people even try the code out before writing it? that code has 6 errors.
here is the correct code:
int hours = DateTime.Now.Hour; int minutes = DateTime.Now.Minute; int seconds = DateTime.Now.Second;
This post has been edited by eclipsed4utoo: 02 July 2008 - 05:52 AM
#4
Re: how to get current time
Posted 02 July 2008 - 05:56 AM
Maybe 3DrunkPandas forgot that there is no hh in DataTime that hh is used when converting DateTime to string and hh is a string format.
#5
Re: how to get current time
Posted 02 July 2008 - 06:16 AM
#6
#7
Re: how to get current time
Posted 02 July 2008 - 12:02 PM
3DrunkPandas, on 2 Jul, 2008 - 11:58 AM, said:
We are here to help others so it's always good to post code that is correct. With you being new to the language(I am also, only about a year and a half under my belt), always do the code in VS before posting it here. Make sure that it does exactly what it should and make sure there are no errors.
#8
Re: how to get current time
Posted 02 July 2008 - 12:06 PM
Come on now guys, he was merely trying to help, and last time I checked thats what we were here for
I've inadvertently posted code that had an error (or 2 lol) in it, it happens.
#9
Re: how to get current time
Posted 03 July 2008 - 04:19 AM
Oh I know that is why I posted what I did I was not putting him down I was just stating that he may have forgotten I have done that myself once or twice, and I apologies if I offended you 3DrunkPandas, that is not what I was trying to do.
This post has been edited by zakary: 03 July 2008 - 04:24 AM
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote




|