Login or Sign Up
Logging in...
Remember me
Log in
Or
Sign Up
Forgot password or user name?
Log in with
Search in titles only
Search in .NET only
Search
Advanced Search
Forums
Product Launch
Updates
Today's Posts
Member List
Calendar
Home
Forum
Topic
.NET
how to convert date time format as yyyyddmm hh:mm:ss in c#?
Collapse
X
Collapse
Posts
Latest Activity
Photos
Page
of
1
Filter
Time
All Time
Today
Last Week
Last Month
Show
All
Discussions only
Photos only
Videos only
Links only
Polls only
Events only
Filtered by:
Clear All
new posts
Previous
template
Next
nirmalsingh
New Member
Join Date:
Sep 2006
Posts:
218
#1
how to convert date time format as yyyyddmm hh:mm:ss in c#?
Jan 5 '07, 05:02 AM
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..
kenobewan
Recognized Expert
Specialist
Join Date:
Dec 2006
Posts:
4871
#2
Jan 5 '07, 05:21 AM
Try placing your date in a string and then form it:
Code:
myDate.ToString("yyyy-MM-dd hh:mm:ss")
OR
Code:
myDate.DateFormat = "yyyy-MM-dd hh:mm:ss";
Hope that this helps.
Comment
Post
Cancel
Jimmy611
New Member
Join Date:
Jan 2007
Posts:
49
#3
Jan 5 '07, 05:23 AM
DateTime.Now.To String("yyyy/MM/dd HH:MM")
Comment
Post
Cancel
radcaesar
Recognized Expert
Contributor
Join Date:
Sep 2006
Posts:
759
#4
Jan 5 '07, 11:51 AM
Try with,
DateTime.Custom Format()
:)
Comment
Post
Cancel
nirmalsingh
New Member
Join Date:
Sep 2006
Posts:
218
#5
Jan 5 '07, 12:32 PM
its rarely working well with
myDate.ToString ("yyyy-MM-dd hh:mm:ss")
but i have an error often as internal server error
Comment
Post
Cancel
kenobewan
Recognized Expert
Specialist
Join Date:
Dec 2006
Posts:
4871
#6
Jan 5 '07, 02:00 PM
May be unrelated:
500 Internal Server Error Resolution
But suggest you post code in case. Does error give you a line number?
Comment
Post
Cancel
Previous
template
Next
Working...
Yes
No
OK
OK
Cancel
👍
👎
☕
Comment