current time + 10 min in yyyy-mm-dd hh:mm format using asp.net/vb.net

Hi

i want to get current system time+10 minutes   in yyyy-MM-dd HH:mm using asp.net/vb.net
i am using .net 3.5 .

Thanks,
ram27Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

DhaestCommented:
You can try this:

Dim currentTime As DateTime = DateTime.Now 
currentTime.AddMinutes(10) 
Dim printDate As String = currentTime.ToString("yyyy-MM-dd HH:mm") 

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Kevin CrossChief Technology OfficerCommented:
You can use the AddMinutes method of DateTime object and then use ToString with format you want.
Dim now As DateTime = DateTime.Now
        MsgBox(now.AddMinutes(10).ToString("yyyy-MM-dd HH:mm"))

Open in new window

0
Kevin CrossChief Technology OfficerCommented:
Ah, too slow. :)
0
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

ram27Author Commented:
hi Dhaest,

i want time in 24hrs format ex: 2009-07-08 20:10 etc.. can you please help
0
DhaestCommented:
It is in 24hrs format ...
0
Kevin CrossChief Technology OfficerCommented:
Agreed!
"yyyy-MM-dd HH:mm" == 24 hour clock w/ leading zero (single H removes leading zero)
"yyyy-MM-dd hh:mm" == 12 hour clock w/ leading zero
0
Mike TomlinsonMiddle School Assistant TeacherCommented:
*In Dhaest's example, you need to change:

    currentTime.AddMinutes(10)

To:

    currentTime = currentTime.AddMinutes(10)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.