473,320 Members | 1,612 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

DateTime problem: how to create datetime format hh:mm:ss AM/PM without the date

my database has separate field for date and time so we can capture
employees' time in and out . In Sql, date can be present in smalldatetime
format, which contains only time hh:mm:ss AM/PM. How can I create datetime
format in C# like that in order to update database? Thanks in advance

Nov 16 '05 #1
1 10061
mimi <mh****@hotmail.com> wrote:
my database has separate field for date and time so we can capture
employees' time in and out . In Sql, date can be present in smalldatetime
format, which contains only time hh:mm:ss AM/PM. How can I create datetime
format in C# like that in order to update database? Thanks in advance


Just use DateTime, and the database should ignore the date part.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Krzysztof Skibniewski | last post by:
Hello, I'm trying find out how to obtain and output that format ( hh:mm:ss.fff ) in my ASP. if somebody knows, pls let me know.. thx kris
2
by: Thomas Bärwinkel | last post by:
Hallo, ich würde gerne zwei Zeitangaben im Format hh:mm:ss addieren. z.B.: 00:01:50 + 01:02:12 = 01:03:02 gibt es in PHP Funktionen mit denen ich Zeiten in diesem Format addieren kann? ...
9
by: Fred Morrison | last post by:
I need to bind a true date value to a listbox control via a DataSet that contains true date values (not strings). The problem is, the list contains the time (always midnight in my case). Other...
1
by: Jason Chan | last post by:
DateTime mydate = new DateTime(2006,1,1,0,0,0); string testStr = mydate.ToString("hh:mm:ss"); //return 12:00:00 mydate = new DateTime(2006,1,1,1,0,0) testStr = mydate.ToString("hh:mm:ss");...
5
nirmalsingh
by: nirmalsingh | last post by:
i am getting date format in string as 30-11-2006 05:59:44 PM . i want to convert in the format of yyyy-mm-dd hh:mm:ss to sore it in mysql database. Help me with sample coding plz..
3
by: | last post by:
I'm doing some work with ffmpeg, which lets you work with audio and video. ffmpeg's command line accepts timecode information as folllows: 00:00:23. HH:MM.SS I want to increment that counter,...
5
by: lofty | last post by:
Hi, I'm building a time report system for work and I want to show the total hours and minutes a project have taken but can't get it to work ... I have a database (MySQL) in one table I have...
1
by: Nerds | last post by:
Greetings, I want to write a schema with the format hh:mm:ss AM so will anyone please give me the Exact code for this. Thanks in Advance weber
2
by: smitanaik | last post by:
hi i want to do validation of datetime in javascripti.e is i want it in this format dd:mm:yyyy:hh:mm:ss plz heklp me out its urgent
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.