473,398 Members | 2,165 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,398 software developers and data experts.

how to display datetime format as yyyyMMddHHmmss?

swarnalaxmi
like year month date hour minute second....? example- 19880413233510
Oct 1 '09 #1
3 17891
PRR
750 Expert 512MB
Expand|Select|Wrap|Line Numbers
  1. DateTime d = DateTime.Now;
  2.             Console.WriteLine(d.ToString("yyyy/MM/dd/HH:mm:ss"));
  3. Console.WriteLine(d.ToString("yyyyMMddHHmmss"));
  4.  
  5.  
Oct 1 '09 #2
Plater
7,872 Expert 4TB
All you had to do was plug the number format into the .ToString().
MSDN has examples of this.
Oct 1 '09 #3

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

Similar topics

3
by: Martin Bless | last post by:
Below is what I'm currently using to construct datatime objects from strings. Date and time objects are made up similar. To and from string conversions are frequently needed in SQL neighborhood. ...
6
by: Thomas Bartkus | last post by:
MySQL Version 4.0.20 on a Linux server. How does one get the elapsed time between (2) DateTime values? I need the answer to the nearest minute. Is upgrading to Ver 5 with its more robust...
55
by: Jazzhouse | last post by:
Hi, How do you get the local date time as YYYYMMDDHHMMSS 14 digit string??? I am very new to C++, but if the MSDN tutorials are like that may be it is better to go with GCC... :) Ferhat
4
by: Mark | last post by:
Is there a way to convert a char to a DateTime without first converting to a string and using DateTime.Parse or ParseExact? I'm trying to reuse the char which can be reused instead of converting...
3
by: Andrew S. Giles | last post by:
Hello, I am importing a flat text file, and putting it into a datagrid for display on a form. Currently the users have their dates and times seperated. I have two fields, therefore in the...
7
by: Tarren | last post by:
Hi: I am pulling duration out of my DB and it returns duration in seconds. For the display i would like to show it in time format with colon So duration of 221 I want it to display 03:41 ...
1
by: Frank Esser | last post by:
Hello, how can I get the date/time value from a string that contains the date and time in this format: YYYYMMDDhhmmss Thanks!
3
by: Eric Stott | last post by:
I need to take System.DateTime.Now and have the resulting text be in the following format: yyyyMMddhh24mmsss I am using System.Convert.ToString(System.DateTime.Now), but I need to format it...
6
by: marc | last post by:
hi im trying to convert Date() into a unix timestamp so i can stick the result into a mysql db, please help!
4
by: simonZ | last post by:
I have string 20070502144551 and I would like to convert this to datetime: 2007-05-02 14:45:51 Is there some function? Regards,Simon
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
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...

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.