Solved

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

Posted on 2009-07-08
7
523 Views
Last Modified: 2013-11-08
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,
0
Comment
Question by:ram27
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
7 Comments
 
LVL 53

Accepted Solution

by:
Dhaest earned 300 total points
ID: 24803739
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
 
LVL 60

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

0
 
LVL 60

Expert Comment

by:Kevin Cross
ID: 24803765
Ah, too slow. :)
0
Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

 

Author Comment

by:ram27
ID: 24803816
hi Dhaest,

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

Expert Comment

by:Dhaest
ID: 24803837
It is in 24hrs format ...
0
 
LVL 60

Assisted Solution

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

Assisted Solution

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

    currentTime.AddMinutes(10)

To:

    currentTime = currentTime.AddMinutes(10)
0

Featured Post

MS Dynamics Made Instantly Simpler

Make Your Microsoft Dynamics Investment Count  & Drastically Decrease Training Time by Providing Intuitive Step-By-Step WalkThru Tutorials.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
AJAX Create / Update Not working MVC 5 67
GUID's in SQL Server 4 31
Call to SQL server times out 5 55
ASP.NET, Globalization, language indexes, translation, conversion. 2 70
For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

751 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