current time + 10 min in yyyy-mm-dd hh:mm format using

Posted on 2009-07-08
Last Modified: 2013-11-08

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

Question by:ram27
LVL 53

Accepted Solution

Dhaest earned 300 total points
ID: 24803739
You can try this:

Dim currentTime As DateTime = DateTime.Now 


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

Open in new window

LVL 59

Assisted Solution

by:Kevin Cross
Kevin Cross earned 150 total points
ID: 24803757
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

LVL 59

Expert Comment

by:Kevin Cross
ID: 24803765
Ah, too slow. :)
3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.


Author Comment

ID: 24803816
hi Dhaest,

i want time in 24hrs format ex: 2009-07-08 20:10 etc.. can you please help
LVL 53

Expert Comment

ID: 24803837
It is in 24hrs format ...
LVL 59

Assisted Solution

by:Kevin Cross
Kevin Cross earned 150 total points
ID: 24803996
"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
LVL 85

Assisted Solution

by:Mike Tomlinson
Mike Tomlinson earned 50 total points
ID: 24804464
*In Dhaest's example, you need to change:



    currentTime = currentTime.AddMinutes(10)

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
WPF - Tooltips for ComboBox items 5 35 checkbox 7 41
C# HTTP GET method sample code 3 40
Adware on IIS hosted website 1 15
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now