473,544 Members | 1,967 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to convert date time format as yyyyddmm hh:mm:ss in c#?

nirmalsingh
218 New Member
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..
Jan 5 '07 #1
5 19168
kenobewan
4,871 Recognized Expert Specialist
Try placing your date in a string and then form it:
Expand|Select|Wrap|Line Numbers
  1. myDate.ToString("yyyy-MM-dd hh:mm:ss")
OR
Expand|Select|Wrap|Line Numbers
  1. myDate.DateFormat = "yyyy-MM-dd hh:mm:ss";
Hope that this helps.
Jan 5 '07 #2
Jimmy611
52 New Member
DateTime.Now.To String("yyyy/MM/dd HH:MM")
Jan 5 '07 #3
radcaesar
759 Recognized Expert Contributor
Try with,

DateTime.Custom Format()

:)
Jan 5 '07 #4
nirmalsingh
218 New Member
its rarely working well with
myDate.ToString ("yyyy-MM-dd hh:mm:ss")
but i have an error often as internal server error
Jan 5 '07 #5
kenobewan
4,871 Recognized Expert Specialist
May be unrelated:
500 Internal Server Error Resolution

But suggest you post code in case. Does error give you a line number?
Jan 5 '07 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

4
17585
by: hikums | last post by:
Does anyone have a function to convert duration in seconds to a format hh:mm:ss Thanks.
2
6930
by: Robert Brown | last post by:
Hi all. I have written a program that transfers data via FTP. I can calculate the rough amount of time left. I get a value such as 70.83 seconds left for instance. What I want to do is to change this to hh:mm:ss format. Obviously, VB.NET doesn't seem to want to convert this unless it is already a DATETIME cast.
14
4068
by: Michael Barrido | last post by:
I have this for example: Dim iSeconds as int32 = 3600 '3600 seconds is one hour How do i convert it to "01:00:00" ? Please help. Thanks in advance!
5
10534
by: kpp9c | last post by:
Hi, I was looking at python & datetime and hoping that it would already have a method/func to translate time formats. I need to translate seconds to hh:mm:ss.ms and vice versa and would like the ability to do some basic arithmetic in these formats. I think that there just has to be a package or module out there that already does this with...
1
2668
seshu
by: seshu | last post by:
Hi every body to morning my cousine has show his application and also his live db in that to sav the length of all the voice files he has saved in time format ie he took the datatype of time now i want to generate a an excell sheet of that table but here i want the time to be like mm:ss but not hh:mm:ss examle the length of song sweet dreams is...
1
2144
seshu
by: seshu | last post by:
Hi every body to morning my cousine has show his application and also his live db in that to sav the length of all the voice files he has saved in time format ie he took the datatype of time now i want to generate a an excell sheet of that table but here i want the time to be like mm:ss but not hh:mm:ss examle the length of song sweet dreams is...
1
3381
by: chindanoor | last post by:
Here is my code... class TimeConverter { public static void main(String ar) { int sec=3650; int min=0; int hour=0; while(sec>=60)
5
32294
by: sudip77 | last post by:
Hi, I have an user input variable called @stop_time which takes input in the format of HH:MM:SS. I need to convert it into seconds only. How can I do that? Can anyone help please?
1
2336
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
0
7420
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7764
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
5904
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5291
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
4911
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3407
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3404
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
983
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
657
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.