Solved

How to implement timespan data entry in ASP.net MVC application using  am/pm for time entry?

Posted on 2014-11-29
3
350 Views
Last Modified: 2014-12-06
How to implement time span data entry in ASP.net MVC application using  am/pm for time entry?
Back end sql table is using time as data type.
0
Comment
Question by:Jugnoo2013
  • 2
3 Comments
 
LVL 21

Expert Comment

by:Craig Wagner
ID: 40472499
TimeSpan has a very specific meaning in .NET, there is a datatype for it. Are you sure that's what you're asking for? Or do you mean "date/time data entry?"
0
 

Author Comment

by:Jugnoo2013
ID: 40472817
I agree but TimeSpan is mapped to time(7) data type in sql server. It will just be used for time only calculations.
0
 
LVL 21

Accepted Solution

by:
Craig Wagner earned 500 total points
ID: 40472887
One problem you're going to run into is that the TimeSpan type represents an interval of time, it has no concept of am/pm. If you're trying to represent a time-of-day you've picked the incorrect type. You'll probably need to use a datetime and then apply an editor mask so only the time portion shows up and is entered.
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
This is about my first experience with programming Arduino.
In this fourth video of the Xpdf series, we discuss and demonstrate the PDFinfo utility, which retrieves the contents of a PDF's Info Dictionary, as well as some other information, including the page count. We show how to isolate the page count in a…
In this fifth video of the Xpdf series, we discuss and demonstrate the PDFdetach utility, which is able to list and, more importantly, extract attachments that are embedded in PDF files. It does this via a command line interface, making it suitable …

803 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